Error message when you update a Web reference in Visual Studio 2008
-
Wednesday, September 17, 2008 6:47 PMAdding the web reference does not throw any errors but no C# files are generated. Therefore, I choose to run the update web reference. The following error is returned:
The custom tool 'MSDiscoCodeGenerator' failed. Unable to import binding 'BindingName' from namespace 'http://NamespaceLocation'.Additionally, you receive the following error message in the Error List window:Error 1 Custom tool error: Unable to import WebService/Schema.
Unable to import binding 'BindingName' from namespace 'http://NamespaceLocation'. Unable to import operation 'OperationName'. These members may not be derived.
Any ideas what is wrong?
All Replies
-
Thursday, September 18, 2008 1:40 PMModeratorJust taking a guess it sounds like your web service reference isn't a web service. I would recommend that you run wsdl outside VS against your target web service and see if it works.
Michael Taylor - 9/18/08
http://p3net.mvps.org -
Thursday, September 18, 2008 2:08 PMWhat do you mean by "run wsdl outside"?
-
Thursday, September 18, 2008 2:21 PMModeratorWhen you add a web reference the IDE runs the wsdl.exe tool under the hood to generate an assembly that knows how to talk to the web service. This is the stuff you see show up in SE. You can run the tool manually against your service to get the same files.
Michael Taylor - 9/18/08
http://p3net.mvps.org -
Thursday, September 18, 2008 5:06 PMC:\Program Files\Microsoft Visual Studio 9.0\VC>wsdl.exe http://localhost:8080/myapp/myservice?wsdl
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: Unable to import binding 'MyServiceBinding' from namespace 'http://w
ww.example.com/MyService'.
- Unable to import operation 'OperationName'.
- These members may not be derived.
If you would like more help, please type "wsdl /?".
-
Thursday, September 18, 2008 5:15 PMModerator
See if this KB article applies to you: http://support.microsoft.com/kb/820122
It can also be caused by a mistyped type or namespace name in the XML file. If neither of these help then please post your .wsdl file so we can look at it.
Michael Taylor - 9/18/08
http://p3net.mvps.org -
Friday, September 19, 2008 2:22 PMOk, the KB is not related, how would I post a zip file of my wsdl and schema?
-
Monday, September 29, 2008 4:35 PM
Here is a sample wsdl with xsds that I created to reproduce the issue.
WSDL: my.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.example.com/MyService"
xmlns:tns="http://www.example.com/MyService"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ws="http://www.example.com/webservice"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:my="http://www.example.com/My">
<!-- SCHEMA IMPORTS -->
<wsdl:types>
<xsd:schema>
<xsd:import namespace="http://www.example.com/My" schemaLocation="myfirst.xsd" />
</xsd:schema>
</wsdl:types>
<!-- FAULT -->
<wsdl:message name="myFault">
<wsdl:part name="fault" element="my:myError" />
</wsdl:message>
<!-- REQEUSTS -->
<wsdl:message name="addMyRequest">
<wsdl:part name="parameters" element="my:addMyRequest"/>
</wsdl:message>
<wsdl:message name="deleteMyRequest">
<wsdl:part name="parameters" element="my:deleteMyRequest"/>
</wsdl:message>
<!-- RESPONSES -->
<wsdl:message name="addMyResponse">
<wsdl:part name="parameters" element="my:addMyResponse" />
</wsdl:message>
<wsdl:message name="deleteMyResponse">
<wsdl:part name="parameters" element="my:deleteMyResponse" />
</wsdl:message>
<!-- PORT TYPES -->
<wsdl:portType name="myManager">
<wsdl:operation name="addMy">
<wsdl:input name="addMyRequest" message="tns:addMyRequest" />
<wsdl:output name="addMyResponse" message="tns:addMyResponse" />
<wsdl:fault name="myFault" message="tns:myFault" />
</wsdl:operation>
<wsdl:operation name="deleteMy">
<wsdl:input name="deleteMyRequest" message="tns:deleteMyRequest" />
<wsdl:output name="deleteMyResponse" message="tns:deleteMyResponse" />
<wsdl:fault name="myFault" message="tns:myFault" />
</wsdl:operation>
</wsdl:portType>
<!-- BINDINGS -->
<wsdl:binding name="mySoapBinding" type="tns:myManager">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="addMy">
<soap:operation soapAction="" style="document" />
<wsdl:input name="addMyRequest">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="addMyResponse">
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="myFault">
<soap:fault name="myFault" use="literal" />
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="deleteMy">
<soap:operation soapAction="" style="document" />
<wsdl:input name="deleteMyRequest">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="deleteMyResponse">
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="myFault">
<soap:fault name="myFault" use="literal" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<!-- SERVICE -->
<wsdl:service name="myService">
<wsdl:port name="myService" binding="tns:mySoapBinding">
<soap:address location="http://localhost:8080/myServiceApp/services/myService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
xsd: myfirst.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://www.example.com/My"
xmlns="http://www.example.com/My"
xmlns:second="http://www.example.com/MySecond"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.example.com/MySecond" schemaLocation="mysecond.xsd"/>
<xs:element name="myError" type="myErrorComplexType"/>
<xs:complexType name="myErrorComplexType">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="message" nillable="false" type="xs:string">
<xs:annotation>
<xs:documentation>Error message.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="addMyRequest">
<xs:complexType>
<xs:sequence>
<xs:element ref="second:identifier"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addMyResponse">
<xs:complexType>
<xs:complexContent>
<xs:extension base="second:myResponseType">
<xs:sequence>
<xs:element ref="second:identifier"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="deleteMyRequest">
<xs:complexType>
<xs:sequence>
<xs:element ref="second:identifier"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="deleteMyResponse">
<xs:complexType>
<xs:complexContent>
<xs:extension base="second:myResponseType"/>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:schema>
xsd: mysecond.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://www.example.com/MySecond"
xmlns="http://www.example.com/MySecond"
xmlns:third="http://www.example.com/MyThird"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.example.com/MyThird" schemaLocation="mythird.xsd"/>
<xs:element name="identifier" type="third:identifierType"/>
<xs:complexType name="myResponseType">
<xs:sequence>
<xs:element name="description" type="third:stringType"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
xsd: mythird.xsd
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://www.example.com/MyThird"
xmlns="http://www.example.com/MyThird"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="identifierType">
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="stringType">
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:schema>
- Proposed As Answer by JDAllen Wednesday, August 19, 2009 9:05 PM
-
Wednesday, August 19, 2009 9:10 PM
-
Saturday, January 23, 2010 10:45 AM
I have the same problem and I cannot change "parameters" to something else as described in http://developers.de/blogs/andreas_erben/archive/2007/02/02/svcutil.exe_2F00_wsdl.exe_3A00_-issue-with-message-part-name-_2200_parameters_2200_.aspx .
Has anyone taken this issue up with WCF support?

