none
Problem with understanding WSDL structure. RRS feed

  • Question

  • Hello. Im trying to create client application for social web service which provide its own WSDL document.

    http://api-beta.reformagkh.ru/api_document_literal/wsdl

    I try to create proxy for this document with svcutil like this

    svcutil http://api-beta.reformagkh.ru/api_document_literal/wsdl /namespace:*,TestReference

    Its generates ApiSoap.cs with a part of types presented in this file.

    For example, this file has description for type "ErrorDetails" - this type returns in server fault answer like this 

        <SOAP-ENV:Fault>
          <faultcode>SOAP-ENV:Client</faultcode>
          <faultstring>Authentication failed</faultstring>
          <detail xsi:type="ns1:ErrorDetails">
            <code>1002</code>
            <name>Authentication failed</name>
            <description>Login failed</description>
          </detail>
        </SOAP-ENV:Fault>

    But the type "ErrorDetails" is not generated by svcutil. I see nothing.

    For example, file contains enum "ProfilePartsEnum", which is a part of complex type "GetFilesInfoFromHouseProfile" in member "profile_part_id". But in generated file i see only type "GetFilesInfoFromHouseProfile" and type of member "profile_part_id" is int! Why not ProfilePartsEnum and why does svcutil skip this and a lot of similar types until generation?


    Sorry of my bad english)


    • Edited by Sellec Tuesday, March 31, 2015 2:25 PM
    Tuesday, March 31, 2015 2:24 PM

Answers

  • Hi,

    Generally speaking, you can use WCF to export WSDL documents from a ServiceDescription instance for your service. WSDL documents are automatically generated for your service when you publish metadata endpoints.

    You can also import ServiceEndpoint instances, ContractDescription instances, and Binding instances from WSDL documents using the WsdlImporter type.

    The WSDL documents, exported by WCF, import any XML Schema definitions used from external XML Schema documents. A separate XML Schema document is exported for each target namespace the data types use in the service.

    And Svcutil.exe generates the client based on the Web Services Description Language (WSDL) or policy file received from the service.

    For more information about ServiceModel Metadata Utility Tool (Svcutil.exe):

    https://msdn.microsoft.com/en-us/library/aa347733(v=vs.110).aspx

    Besides, if there is any misunderstand, please feel free to let me know and you could describe the issue in detail.

    Regards

    Thursday, April 2, 2015 2:52 AM
    Moderator