web-dev-qa-db-fra.com

Impossible d'importer wsdl: portType, wsdl: binding, wsdl: port

Je reçois une erreur lors de la génération du proxy pour WCF à l'aide de SVCUtil. L'erreur est

Attempting to download metadata from 'net.pipe://localhost/WebServices/Mgmt.svc' using WS-Metadata Exchange. This URL does not support DISCO.
Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Referenced type 'SearchCriteria, Service.DataContracts, Version=2.5.0.0, Culture=neutral, PublicKeyToken=null
t be used since it does not match imported DataContract. Need to exclude this type from referenced types.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IMgmt']


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://tempuri.org/']/wsdl:portType[@name='IMgmt']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='NetNamedPipeBinding_IMgmt']


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://tempuri.org/']/wsdl:binding[@name='NetNamedPipeBinding_IMgmt']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='Mgmt']/wsdl:port[@name='NetNamedPipeBinding_I


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.

Tout fonctionnait bien jusqu'à ce que j'ajoute un membre enum dans le contrat de données.

19
Pranav Singh

Il s'est avéré que nous réutilisons DataContract tout en générant un proxy et l'ancienne DLL DataContract n'a pas été remplacée à l'emplacement d'où elle est référencée.

Obtenez également de l'aide à partir d'une réponse à la question qu'est-ce-que-cette-erreur-wcf signifie un avertissement d'outil personnalisé-ne peut pas importer-wsdlporttype?

2
Pranav Singh

Un autre problème pourrait être de ne pas transmettre tous les XSD à svcutil. Notre problème était que nous utilisions

svcutil.exe service.wsdl

au lieu de

svcutil.exe service.wsdl first.xsd second.xsd ......

Pour info, nous intégrions Java web services à notre service wcf/client .net.

13
spicet