Not able to add wcf web service to netstandard2.0 class library project
- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 576
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 2
Description
**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

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.
Contributor guide
Assessment
This issue has not been assessed yet.