locked
Connecting to AXIS web service with .NET and disconnected and unvalidated WSDL

    Question

  • I need some help solving a complex problem.  My experience with web services has been with ASMX and .NET.

    I was given the task of writing a Windows Application client to connect to a web service on an Apache AXIS server.  However, the WSDL is not hosted on the server, but rather provided to me separately.

    Now, I am not certain that the WSDL is valid in the first place, and even less certain whether it is valid for .NET.

    But when I try to add the web reference, the error I get is the following:

    "Custom tool error: Unable to import WebService/Schema.  Unable to import binding 'somename' from namespace 'someaddress'.  Unable to import operation 'somewebmethod'.  Missing message part 'somevariablename' for message 'somemessage' from namespace 'someaddress'.  Parameter name: partName

    Can someone walk me through how to validate the WSDL to make sure it works in the first place, to validate it so that it works with .NET, then add it as a web reference in VS.NET 2K3?

    Friday, December 23, 2005 5:55 PM

Answers

  • It turns out that that the error message is right on the money.

    For example, the body parts definition in the binding

    <wsdl:binding name="Lookup" type="tns:LookupPortType">
    <wsdl:input>
    <
    soap:body parts="user password" use="literal"/>
    </
    wsdl:input>
    </wsdl:binding>

     does not correspond to the part names in message section

    <wsdl:message name="userLookup">
    <
    wsdl:part name="User" type="pmg:UserInfo"/>
    <
    wsdl:part name="Password" type="xsd:string"/>
    </wsdl:message>

    as in the case do not match, or if they contain different names all together.  In other words, it was a problem where the variables need to be defined before they can be referenced, and it is case sensitive.

    Then, because the WSDL contains a complex type definition, VS2003 refused to load the web reference as operation is unsupported or something.  VS2005 loaded it fine.

     

    Friday, December 30, 2005 4:18 PM

All replies

  • It turns out that that the error message is right on the money.

    For example, the body parts definition in the binding

    <wsdl:binding name="Lookup" type="tns:LookupPortType">
    <wsdl:input>
    <
    soap:body parts="user password" use="literal"/>
    </
    wsdl:input>
    </wsdl:binding>

     does not correspond to the part names in message section

    <wsdl:message name="userLookup">
    <
    wsdl:part name="User" type="pmg:UserInfo"/>
    <
    wsdl:part name="Password" type="xsd:string"/>
    </wsdl:message>

    as in the case do not match, or if they contain different names all together.  In other words, it was a problem where the variables need to be defined before they can be referenced, and it is case sensitive.

    Then, because the WSDL contains a complex type definition, VS2003 refused to load the web reference as operation is unsupported or something.  VS2005 loaded it fine.

     

    Friday, December 30, 2005 4:18 PM
  • Man, why am I answering my own questions?  Aren't there any experts out there who have all the answers?

    Anyways, I found a great debugging tool for web services called SOAPSonar at http://www.crosschecknet.com/

    It does validation and invocation.  And you can see the request//response in XML!

    Saturday, December 31, 2005 2:24 AM
  • Hi,

    i am also getting this eror..i  stuck here...

    I have added Web Reference to my WCSF Service in ASP.NET and it gives me following error when i do build:

    Error    108    Unable to import binding 'WSHttpBinding_IEmpService' from namespace 'XYZ'.    App_WebReferences/EmployeeClient/   

    i tried to use wsdl.exe tool and that VS Command Prompt tool gave me following error:
    Error: Unable to import binding 'WSHttpBinding_IEmpService' from namespace
     'XYZ'.
      - Unable to import operation 'GetListByCodeType'.
      - Unable to cast object of type 'System.Xml.Serialization.StructMapping' to ty
    pe 'System.Xml.Serialization.MembersMapping'.

    Pls guide me what i do..

    Regards,
    Kiran


    Thursday, April 17, 2008 1:09 PM