Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Adding Connected Service #4275

Closed
roend83 opened this issue May 14, 2020 · 12 comments
Closed

Error Adding Connected Service #4275

roend83 opened this issue May 14, 2020 · 12 comments

Comments

@roend83
Copy link

roend83 commented May 14, 2020

I'm getting the following error trying to add connected service reference to an IBM hosted SOAP service in our internal network:

image

This service is hosted inside the company firewall so I can't give you a reproduction, but here's the associated WSDL:

<!--
File MS_Common_MessageRouter/com/adesa/schemas/ih/msgrouter/MsgRouter.wsdl, application I0021_APP_COMMON_MsgRouter, static library I0021_LIB_COMMON_MessageRouter
-->
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://schemas.adesa.com/IH/MsgRouter" xmlns:wsdl1="http://schemas.adesa.com/IH/MsgRouter" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsd1="http://schemas.adesa.com/IH/MsgRouter" name="MsgRouter" targetNamespace="http://schemas.adesa.com/IH/MsgRouter">
<wsdl:documentation>
<wsdl:appinfo source="WMQI_APPINFO">
<MRWSDLAppInfo imported="true">
<generatedMXSD location="MsgRouter_InlineSchema1.mxsd"/>
<binding hasEncoding="false" imported="true" name="MsgRouterSOAP" originalBindingStyle="document"/>
</MRWSDLAppInfo>
</wsdl:appinfo>
</wsdl:documentation>
<wsdl:types>
<xsd:schema targetNamespace="http://schemas.adesa.com/IH/MsgRouter">
<xsd:include schemaLocation="http://inthub.test.auctionintegrationhub.com:80/MsgRouter?xsd=xsd0"/>
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://schemas.adesa.com/IH/MsgRouter" schemaLocation="http://inthub.test.auctionintegrationhub.com:80/MsgRouter?xsd=xsd1"> </xsd:import>
<xsd:import namespace="http://schemas.adesa.com/IH/MsgRouter" schemaLocation="http://inthub.test.auctionintegrationhub.com:80/MsgRouter?xsd=xsd2"> </xsd:import>
</xsd:schema>
</wsdl:types>
<wsdl:message name="RouteMessageRequest">
<wsdl:part element="xsd1:MsgRouterRequest" name="parameters"/>
</wsdl:message>
<wsdl:message name="RouteMessageResponse">
<wsdl:part element="xsd1:MsgRouterResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="MsgRouter">
<wsdl:operation name="RouteMessage">
<wsdl:input message="tns:RouteMessageRequest"/>
<wsdl:output message="tns:RouteMessageResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MsgRouterSOAP" type="tns:MsgRouter">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="RouteMessage">
<soap:operation soapAction="http://schemas.adesa.com/IH/MsgRouter/RouteMessage"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MsgRouter">
<wsdl:port binding="tns:MsgRouterSOAP" name="MsgRouterSOAP">
<soap:address location="http://inthub.test.auctionintegrationhub.com:80/MsgRouter"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
@roend83
Copy link
Author

roend83 commented May 14, 2020

I'm running Visual Studio Enterprise 2019 version 16.5.4

@roend83
Copy link
Author

roend83 commented May 14, 2020

Note the latest version of the dotnet-svcutil global tool does appear to work for this service

@dasetser
Copy link
Contributor

@imcarolwang Can you try reproing this and let us know which version of dotnet-svcutil this works on and verify if the latest version of VS is using an older version? If it works with the latest dotnet-svcutil we just need to update the verison VS is using.

@imcarolwang
Copy link
Contributor

@dasetser I got other error: "the remote name couldn't be resolved: 'inthub.test.auctionintegrationhub.com'" when trying to reproduce the issue with the given wsdl, because the referenced schema and the service server are unavailable. Thoughts?

@roend83
Copy link
Author

roend83 commented May 20, 2020 via email

@imcarolwang
Copy link
Contributor

Thanks @roend83.

The tool version VS used can be found by checking path similar as:

"%systemdrive%\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\IDE\Extensions\Microsoft\WCF Connected Service\Microsoft.Tools.ServiceModel.Svcutil.dll"

The global tool is a nuget package installed to the machine, file to check:

"%userprofile%.nuget\packages\dotnet-svcutil-lib\2.0.2\lib\netcoreapp2.1\dotnet-svcutil-lib.dll"

@roend83
Copy link
Author

roend83 commented May 21, 2020

@imcarolwang

image

image

@imcarolwang
Copy link
Contributor

Thank you for the sharing,@roend83. The versions seem matched. Is it possible you are hitting the same problem as in #2546, #2862?

@klinki
Copy link

klinki commented May 28, 2020

Hello @imcarolwang ,

I have very similar problem.
When I create service in old .NET 4.8 project, everything works fine, Add service reference window can detect the SOAP service and generate code.

2020-05-28

When I try to do the same with .NET Core 3.1 project and add WCF Web Service Reference, it shows warnings and doesn't detect any methods in soap service.

2020-05-28 (1)

Warning details are following:
2020-05-28 (2)

Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='urn:order']/wsdl:binding[@name='AvangateAPIBinding']
XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:order']/wsdl:service[@name='AvangateService']/wsdl:port[@name='AvangateAPIPort']
Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='urn:order']/wsdl:portType[@name='AvangateAPIPortType']
XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:order']/wsdl:binding[@name='AvangateAPIBinding']
Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: The complexType 'urn:order:SkuPricingOptionsArray' has already been declared.
XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:order']/wsdl:portType[@name='AvangateAPIPortType']

if I ignore these warnings and click finish, I get the same error windows as @roend83.

2020-05-28 (3)

Importing web service metadata ...
Number of service endpoints found: 0
Scaffolding service reference code ...
Warning:Warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: The complexType 'urn:order:SkuPricingOptionsArray' has already been declared.
XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:order']/wsdl:portType[@name='AvangateAPIPortType']
Warning:Warning: Cannot import wsdl:port
Detail: 
XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:order']/wsdl:service[@name='AvangateService']/wsdl:port[@name='AvangateAPIPort']
Warning:Warning: No endpoints compatible with .Net Core apps were found.
Warning:Warning: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='urn:order']/wsdl:portType[@name='AvangateAPIPortType']
XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:order']/wsdl:binding[@name='AvangateAPIBinding']
Error:Error: No code was generated.
If you were trying to generate a client, this could be because the metadata documents did not contain any valid contracts or services, or because all contracts/services were discovered to exist in --reference assemblies. Verify that you passed all the metadata documents to the tool.
Done.

I'm trying to generate client for this SOAP service: https://api.avangate.com/soap/6.0/?wsdl

@imcarolwang
Copy link
Contributor

@klinki Your problem seems different than reported in this issue, check the error message:

Error: The complexType 'urn:order:SkuPricingOptionsArray' has already been declared.

While @roend83 's problem is:

Could not load file or assembly 'System.ServiceModel.Primitives, Version=4.2.0.3, ...'

@klinki
Copy link

klinki commented May 29, 2020

Oh I see, you are right. I will create another issue for that.

Edit: I created #4291

@HongGit
Copy link
Contributor

HongGit commented Jun 11, 2020

@roend83 has your issue been resolved?

@HongGit HongGit closed this as completed Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants