none
SVCUtil Not able to import Binding Having UsingAddressing RRS feed

  • Question

  • Hello,

    I am trying to  generate server side code using svcutil tool. This is the Sample WSDL  having usingAddressing in the  binding section. But  when tryting to generate service code using svcutil , i am getting this  error - 

    Error: Cannot import wsdl:binding
    Detail: The required WSDL extension element 'UsingAddressing' from namespace 'ht
    tp://www.w3.org/2005/08/addressing/' was not handled.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'
    ]/wsdl:binding[@name='DefaultBinding_IService2']

    Here is the WSDL - 

    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
                      xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
                      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
                      xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
                      xmlns:tns="http://tempuri.org/" 
                      xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
                      xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" 
                      xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" 
                      xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" 
                      xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" 
                      xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
                      xmlns:wsa10="http://www.w3.org/2005/08/addressing" 
                      xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" 
                      targetNamespace="http://tempuri.org/" 
                      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
        <xsd:schema targetNamespace="http://tempuri.org/Imports">
          <xsd:import namespace="http://tempuri.org/" schemaLocation="Avanish1.xsd" />
          <xsd:import namespace="http://schemas.microsoft.com/2003/10/Serialization/"  schemaLocation="Avanish3.xsd"/>
          <xsd:import namespace="http://schemas.datacontract.org/2004/07/Avanish" schemaLocation="Avanish2.xsd" />
        </xsd:schema>
      </wsdl:types>
      <wsdl:message name="IService2_GetData_InputMessage">
        <wsdl:part name="parameters" element="tns:GetData" />
      </wsdl:message>
      <wsdl:message name="IService2_GetData_OutputMessage">
        <wsdl:part name="parameters" element="tns:GetDataResponse" />
      </wsdl:message>
      <wsdl:message name="IService2_GetDataUsingDataContract_InputMessage">
        <wsdl:part name="parameters" element="tns:GetDataUsingDataContract" />
      </wsdl:message>
      <wsdl:message name="IService2_GetDataUsingDataContract_OutputMessage">
        <wsdl:part name="parameters" element="tns:GetDataUsingDataContractResponse" />
      </wsdl:message>
      <wsdl:portType name="IService2">
        <wsdl:operation name="GetData">
          <wsdl:input wsaw:Action="http://tempuri.org/IService2/GetData" message="tns:IService2_GetData_InputMessage" />
          <wsdl:output wsaw:Action="http://tempuri.org/IService2/GetDataResponse" message="tns:IService2_GetData_OutputMessage" />
        </wsdl:operation>
        <wsdl:operation name="GetDataUsingDataContract">
          <wsdl:input wsaw:Action="http://tempuri.org/IService2/GetDataUsingDataContract" message="tns:IService2_GetDataUsingDataContract_InputMessage" />
          <wsdl:output wsaw:Action="http://tempuri.org/IService2/GetDataUsingDataContractResponse" message="tns:IService2_GetDataUsingDataContract_OutputMessage" />
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="DefaultBinding_IService2" type="tns:IService2">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsa10:UsingAddressing  wsdl:required="true" xmlns:wsa10="http://www.w3.org/2005/08/addressing/" />
        <wsdl:operation name="GetData">
          <soap:operation soapAction="http://tempuri.org/IService2/GetData" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="GetDataUsingDataContract">
          <soap:operation soapAction="http://tempuri.org/IService2/GetDataUsingDataContract" style="document" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
    </wsdl:definitions>

    Need some help..could not find anything on this anywhere

    Sunday, May 18, 2014 2:51 AM

Answers

All replies

  • Hi,

    >>Error: Cannot import wsdl:binding
    Detail: The required WSDL extension element 'UsingAddressing' from namespace 'ht
    tp://www.w3.org/2005/08/addressing/' was not handled.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'
    ]/wsdl:binding[@name='DefaultBinding_IService2']

    It seems that the schema used by the wsdl does not conform to the Data Contract Serializer's Schema Reference.

    For more information, please try to refer to:
    #Problem with generating WebService proxy using svcutil:
    http://stackoverflow.com/questions/906082/problem-with-generating-webservice-proxy-using-svcutil .

    Also please try to check this similar thread:
    http://stackoverflow.com/questions/5553618/warning-the-optional-wsdl-extension-element-body-from-namespace-http-schem .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 19, 2014 10:11 AM
    Moderator
  • How is this an answer to the problem?

    I have the same issue. A WSDL file describing a web service has been supplied to us. It contains the assertion:-

    <wsaw:UsingAddressing wsdl:required="true" />

    I want to run svcutil.exe over this to generate a class library to help me build a client application to talk to the web service. But the .NET tool complains:-

    Error: Cannot import wsdl:binding
    Detail: The required WSDL extension element 'UsingAddressing' from namespace 'http://www.w3.org/2006/05/addressing/wsdl' was not handled.

    If I change it to <wsaw:UsingAddressing wsdl:required="false" />

    I get warnings instead of errors. But the tool still does not like the element "UsingAddressing".

    Does the svcutil.exe tool simply not support this piece of WSDL syntax?

    Monday, January 8, 2018 3:24 PM