Cannot import wsdl:portType

Nov 10, 2009 at 8:27 PM

I am able to generate the wsdl file from the xsd file successfully. But when I try to generate the web service code from the xsd by right clicking on the wsdl, I get the following error. Can anybody help me why this error is being generated.

Cannot import wsdl:portType

Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter<font size="1" color="#00ff00"><font size="1" color="#00ff00">

Error: Schema with target namespace '' could not be found.

XPath to Error Source: //wsdl:definitions[@targetNamespace='TestServiceNamespace']/wsdl:portType[@name='TestServiceInterface']


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='TestServiceNamespace']/wsdl:portType[@name='TestServiceInterface']

XPath to Error Source: //wsdl:definitions[@targetNamespace='TestServiceNamespace']/wsdl:binding[@name='BasicHttpBinding_TestServiceInterface']


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='TestServiceNamespace']/wsdl:binding[@name='BasicHttpBinding_TestServiceInterface']

XPath to Error Source: //wsdl:definitions[@targetNamespace='TestServiceNamespace']/wsdl:service[@name='TestServicePort']/wsdl:port[@name='TestServicePort']


</font></font><font size="1" color="#00ff00">




Nov 20, 2009 at 12:19 PM

Would it be possible for you to attach the WSDL and XSD files for testing? I can arrange for them to be email directly if you would prefer not to post them here.

Feb 23, 2010 at 2:30 AM

A coworker and I ran into this issue as well.  Entering in the XML Namespace field in the first screen of the wizard seemed to fix it for us, although I haven't bothered to find out why yet.  This is a bit surprising since the older ASMX documentation here shows a custom URN being used instead of the official WSDL namespace.