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

Not able to add wcf web service to netstandard2.0 class library project #5721

Open
npalla-tyler opened this issue Dec 20, 2024 · 2 comments
Open

Comments

@npalla-tyler
Copy link

npalla-tyler commented Dec 20, 2024

Describe the bug
I have been trying to add an existing WCF service (wsdl) to netstandard2.0 project and getting the following error. Not sure how to get over this issue. Any help is greatly appreciated.

To Reproduce
Steps to reproduce the behavior:
Project -> Add -> Connected Service -> WCF Web Service
Image
Error Details:
Cannot import wsdl:port\r\nDetail: \r\nXPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.tylertechnologies.com']/wsdl:service[@name='Shortener']/wsdl:port[@name='ShortenerPort']
Cannot import wsdl:binding\r\nDetail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.\r\nXPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://www.tylertechnologies.com']/wsdl:portType[@name='ShortenerPortType']\r\nXPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.tylertechnologies.com']/wsdl:binding[@name='ShortenerBinding']
Cannot import wsdl:portType\r\nDetail: The ':' character, hexadecimal value 0x3A, cannot be included in a name.
Parameter name: name\r\nXPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.tylertechnologies.com']/wsdl:portType[@name='ShortenerPortType']

svcutil output given below
PS C:\tylerdev\test> svcutil /t:code /o:ShortenerProxy.cs https://mymachine-app.corp.tylertechnologies.com:8447/tylercmedge/services/Shortener.wsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.8.3928.0]
Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'https://mymachine-app.corp.tylertechnologies.com:8447/tylercmedge/services/Shortener.wsdl' using WS-Metadata Exchange or DISCO.
Error: Cannot import wsdl:portType
Detail: The ':' character, hexadecimal value 0x3A, cannot be included in a name.
Parameter name: name
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.tylertechnologies.com']/wsdl:portType[@name='ShortenerPortType']

Error: 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='http://www.tylertechnologies.com']/wsdl:portType[@name='ShortenerPortType']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.tylertechnologies.com']/wsdl:binding[@name='ShortenerBinding']

Error: 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='http://www.tylertechnologies.com']/wsdl:binding[@name='ShortenerBinding']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.tylertechnologies.com']/wsdl:service[@name='Shortener']/wsdl:port[@name='ShortenerPort']

Generating files...
Warning: 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.

Warning: If you would like to generate data contracts from schemas make sure to use the /dataContractOnly option.

Expected behavior
I would expect to add the wcf reference to the the project.

Screenshots
Added above

Additional context
I am able to generate proxy using wsdl.exe file but not with svcutil or dotnet-svcutil or as connected Service to netstandard package.

@npalla-tyler
Copy link
Author

npalla-tyler commented Dec 20, 2024

I am not able to attach wsdl file as attachment here, so added it as comment below.

@npalla-tyler
Copy link
Author

npalla-tyler commented Dec 20, 2024

<types>
</types>

<message name="getShortViewerLink3Request">
	<part name="in1" type="xsd:string" />
</message>

<message name="generatePhotoviewerURL1Response">
	<part name="result" type="xsd:string" />
</message>

<message name="generateViewerURL4Request">
	<part name="in1" type="xsd:string" />
</message>

<message name="getLongViewerLink5Request">
	<part name="in1" type="xsd:string" />
</message>

<message name="getLongViewerLink5Response">
	<part name="result" type="xsd:string" />
</message>

<message name="getShortViewerLink3Response">
	<part name="result" type="xsd:string" />
</message>

<message name="getEmailViewerLink2Response">
	<part name="result" type="xsd:string" />
</message>

<message name="generatePhotoviewerURL1Request">
	<part name="in1" type="xsd:string" />
</message>

<message name="generateViewerURL4Response">
	<part name="result" type="xsd:string" />
</message>

<message name="getEmailViewerLink2Request">
	<part name="in1" type="xsd:string" />
	<part name="in2" type="xsd:string" />
	<part name="in3" type="xsd:string" />
</message>

<portType name="ShortenerPortType">
	<operation name="generatePhotoviewerURL">
		<input name="tns:generatePhotoviewerURL1Request" message="tns:generatePhotoviewerURL1Request" />
		<output name="tns:generatePhotoviewerURL1Response" message="tns:generatePhotoviewerURL1Response" />
	</operation>
	<operation name="getEmailViewerLink">
		<input name="tns:getEmailViewerLink2Request" message="tns:getEmailViewerLink2Request" />
		<output name="tns:getEmailViewerLink2Response" message="tns:getEmailViewerLink2Response" />
	</operation>
	<operation name="getShortViewerLink">
		<input name="tns:getShortViewerLink3Request" message="tns:getShortViewerLink3Request" />
		<output name="tns:getShortViewerLink3Response" message="tns:getShortViewerLink3Response" />
	</operation>
	<operation name="generateViewerURL">
		<input name="tns:generateViewerURL4Request" message="tns:generateViewerURL4Request" />
		<output name="tns:generateViewerURL4Response" message="tns:generateViewerURL4Response" />
	</operation>
	<operation name="getLongViewerLink">
		<input name="tns:getLongViewerLink5Request" message="tns:getLongViewerLink5Request" />
		<output name="tns:getLongViewerLink5Response" message="tns:getLongViewerLink5Response" />
	</operation>
</portType>

<binding name="ShortenerBinding" type="tns:ShortenerPortType">
	<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
	<operation name="generatePhotoviewerURL">
		<soap:operation soapAction="" />
		<input name="tns:generatePhotoviewerURL1Request">
			<soap:body namespace="urn:Shortener" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
		</input>
		<output name="tns:generatePhotoviewerURL1Response">
			<soap:body namespace="urn:Shortener" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
		</output>
	</operation>
	<operation name="getEmailViewerLink">
		<soap:operation soapAction="" />
		<input name="tns:getEmailViewerLink2Request">
			<soap:body namespace="urn:Shortener" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
		</input>
		<output name="tns:getEmailViewerLink2Response">
			<soap:body namespace="urn:Shortener" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
		</output>
	</operation>
	<operation name="getShortViewerLink">
		<soap:operation soapAction="" />
		<input name="tns:getShortViewerLink3Request">
			<soap:body namespace="urn:Shortener" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
		</input>
		<output name="tns:getShortViewerLink3Response">
			<soap:body namespace="urn:Shortener" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
		</output>
	</operation>
	<operation name="generateViewerURL">
		<soap:operation soapAction="" />
		<input name="tns:generateViewerURL4Request">
			<soap:body namespace="urn:Shortener" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
		</input>
		<output name="tns:generateViewerURL4Response">
			<soap:body namespace="urn:Shortener" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
		</output>
	</operation>
	<operation name="getLongViewerLink">
		<soap:operation soapAction="" />
		<input name="tns:getLongViewerLink5Request">
			<soap:body namespace="urn:Shortener" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
		</input>
		<output name="tns:getLongViewerLink5Response">
			<soap:body namespace="urn:Shortener" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
		</output>
	</operation>
</binding>

<service name="Shortener">
	<documentation>Spheon JSOAP</documentation>
	<port name="ShortenerPort" binding="tns:ShortenerBinding">
		<soap:address location="https://dbkdulpvqa-app.corp.tylertechnologies.com:8447/tylercmedge/services/Shortener" />
	</port>
</service>

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

1 participant