dotnet / wcf

This repo contains the client-oriented WCF libraries that enable applications built on .NET Core to communicate with WCF services.
MIT License
1.72k stars 558 forks source link

Can't generate proxy using WSDL file with "no valid endpoints" error #2215

Closed petr-kirillov closed 7 years ago

petr-kirillov commented 7 years ago

Trying to generate proxy using Travelport WSDL file in VS2017 using "Microsoft WCF Web Service Reference Provider" for my .NET Core or Standard project and hitting "The service at the following URI does not have any valid endpoints" error.

Below is the extraction from WSDL file (refer to Terminal.wsdl.zip for complete file).

There are endpoints defined in <soap:address> elements:

<?xml version="1.0" encoding="UTF-8"?> 

<definitions name="TerminalServices"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:tns="http://www.travelport.com/service/terminal_v33_0"
             xmlns:ur="http://www.travelport.com/schema/terminal_v33_0"             
             xmlns:ns1="http://www.travelport.com/schema/terminal_v33_0"
             xmlns:common="http://www.travelport.com/schema/common_v33_0"             
             targetNamespace="http://www.travelport.com/service/terminal_v33_0">

    <service name="TerminalService">
        <port name="CreateTerminalSessionServicePort" binding="tns:CreateTerminalSessionServiceBinding">
            <soap:address location="http://localhost:8080/kestrel/TerminalService"/>
        </port>
        <port name="TerminalServicePort" binding="tns:TerminalServiceBinding">
            <soap:address location="http://localhost:8080/kestrel/TerminalService"/>
        </port>
        <port name="EndTerminalSessionServicePort" binding="tns:EndTerminalSessionServiceBinding">
            <soap:address location="http://localhost:8080/kestrel/TerminalService"/>
        </port>
    </service>

</definitions>
hongdai commented 7 years ago

@petr-kirillov In the case of no valid endpoints, there should be more information on the last window you see. Could you copy and paste it here?

We will also take a look at the wsdl file.

Thanks, Hong Dai

petr-kirillov commented 7 years ago

@hongdai WSDL is attached https://github.com/dotnet/wcf/files/1239015/Terminal.wsdl.zip

and here is the screenshot from VS:

image

hongdai commented 7 years ago

@petr-kirillov The wsdl file has problems. See below detailed messages:

Warning: Cannot import wsdl:binding Detail: Element message named CreateTerminalSessionServicePortType from namespace http://www.travelport.com/service/terminal_v33_0 is missing. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.travelport.com/service/terminal_v33_0']/wsdl:binding[@name='CreateTerminalSessionServiceBinding']

Warning: Cannot import wsdl:port Detail: XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.travelport.com/service/terminal_v33_0']/wsdl:service[@name='TerminalService']/wsdl:port[@name='CreateTerminalSessionServicePort']

Warning: Cannot import wsdl:binding Detail: Element message named TerminalServicePortType from namespace http://www.travelport.com/service/terminal_v33_0 is missing. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.travelport.com/service/terminal_v33_0']/wsdl:binding[@name='TerminalServiceBinding']

Warning: Cannot import wsdl:port Detail: XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.travelport.com/service/terminal_v33_0']/wsdl:service[@name='TerminalService']/wsdl:port[@name='TerminalServicePort']

Warning: Cannot import wsdl:binding Detail: Element message named EndTerminalSessionServicePortType from namespace http://www.travelport.com/service/terminal_v33_0 is missing. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.travelport.com/service/terminal_v33_0']/wsdl:binding[@name='EndTerminalSessionServiceBinding']

Warning: Cannot import wsdl:port Detail: XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.travelport.com/service/terminal_v33_0']/wsdl:service[@name='TerminalService']/wsdl:port[@name='EndTerminalSessionServicePort']

Error: No endpoints compatible with .Net Core apps were found.

BladeWise commented 7 years ago

I am facing a similar issue, can I know where did you get that log information from?

hongdai commented 7 years ago

@BladeWise Currently we do not always show the warning/error messages to the UI. You should be able to see the warning/error message by using dotnet-svcutil.dll directly: 1) find the path to dotnet-svcutil.dll 2) dotnet dotnet-svcutil.dll /tf:netcoreapp1.0 /Verbosity:Verbose

Thanks, Hong Dai

BladeWise commented 7 years ago

Using the dotnet-svcutil.dll everything is fine, and no error message is produced (I used /tf:netstandard20 without issues).