Skip to main content

Problems Consuming WSDLs

Problems Consuming WSDLs

You may see an error in the SOAP Wizard (or when using the corresponding %SOAP.WSDL.ReaderOpens in a new tab class) for several reasons:

  • The WSDL URL that you supplied may require authentication with an SSL certificate, and you did not specify an SSL configuration or you specified an incorrect SSL configuration. If so, an error message appears, for example:

    ERROR #6301: SAX XML Parser Error: invalid document structure 
    while processing Anonymous Stream at line 1 offset 1
    

    To correct this error, you can specify the appropriate SSL configuration.

  • The WSDL URL that you supplied requires authentication with a username and password. If so, an error message appears, for example:

    ERROR #6301: SAX XML Parser Error: Expected entity name for reference 
    while processing Anonymous Stream at line 10 offset 27 
    
    Note:

    While the line and the offset values may vary, they will differ from those in the previous scenario.

    To correct this error, you can specify a username and password as described in Using the SOAP Wizard, and Using a Password-Protected WSDL URL.

  • The WSDL may contain references to externally defined entities that the wizard could not resolve before 10-second timeout period. If so, an error message appears, for example:

    ERROR #6416: Element 'wsdl:definitions' - unrecognized wsdl element 'porttype'
    

    To correct this error, you can check the WSDL for <import> and <include> directives, for example:

    <import namespace="https://example.com/stockquote/definitions"
               location="https://example.com/stockquote/stockquote.wsdl"/>
    

    If you find such directives, take the following steps:

    1. Download the primary WSDL to a file.

    2. Download the referenced WSDL to a file.

    3. Edit the primary WSDL to refer to the new location of the referenced WSDL.

    Similarly, you can check whether the WSDL refers to other documents using a relative URL, for example:

    xmlns:acme="urn:acme.com.:acme:service:ServiceEndpointInterface" 
    

    If you downloaded the WSDL to a file, you cannot use relative references. Instead, you must also download the referenced document and edit the WSDL to point to its new location.

  • The WSDL contains <message> elements with multiple parts and uses document-style binding. If so, an error message appears, for example:

    ERROR #6425: Element 'wsdl:binding:operation:msg:input' - message 'AddSoapOut' 
    Message Style must be used for document style message with 2 or more parts.
    
    

    To correct this error, you can select the Use unwrapped message format for document style web methods option when you use the wizard.

  • The WSDL is invalid. If so, an error message appears, for example:

    ERROR #6419: Element 'wsdl:binding:operation' - inconsistent
    soap:namespace for operation getWidgetInfo
    

    The error message specifies the problem with the WSDL. In this example, the <operation> element in the following WSDL excerpt produced the error:

    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="https://acme.acmecorp.biz:9999/widget/services" 
                      xmlns="https://schemas.xmlsoap.org/wsdl/" 
                      xmlns:wsdl="https://schemas.xmlsoap.org/wsdl/" =
                     [parts omitted]>
      <wsdl:message name="getWidgetInfoRequest">
      </wsdl:message>
      <wsdl:message name="getWidgetInfoResponse">
        <wsdl:part name="getWidgetInfoReturn" type="xsd:string"/>
      </wsdl:message>
      <wsdl:portType name="Version">
        <wsdl:operation name="getWidgetInfo">
          <wsdl:input message="impl:getWidgetInfoRequest" name="getWidgetInfoRequest"/>
          <wsdl:output message="impl:getWidgetInfoResponse" name="getWidgetInfoResponse"/>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="VersionSoapBinding" type="impl:Version">
        <wsdlsoap:binding style="rpc" transport="https://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="getWidgetInfo">
          <wsdlsoap:operation soapAction=""/>
          <wsdl:input name="getWidgetInfoRequest">
            <wsdlsoap:body encodingStyle="https://schemas.xmlsoap.org/soap/encoding/" 
                           namespace="https://acmesubsidiary.com" 
                           use="encoded"/>
          </wsdl:input>
          <wsdl:output name="getWidgetInfoResponse">
            <wsdlsoap:body encodingStyle="https://schemas.xmlsoap.org/soap/encoding/"                                       
                           namespace="https://acme.acmecorp.biz:9999/widget/services" 
                           use="encoded"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      [parts omitted]
    

    In this case, the problem is that the <input> part of <operation> states that the request message (getVersionRequest) is in the namespace "https://acmesubsidiary.com", but the earlier part of the WSDL shows that this message is the target namespace of the web service: "https://acme.acmecorp.biz:9999/widget/services".

    Note that an invalid WSDL document can be a valid XML document, so using a pure XML tool to validate the WSDL is not a sufficient test. Some third-party WSDL validation tools are available, and you can also examine the WSDL directly, using information returned by the SOAP wizard.

  • The WSDL contains features that are not supported in InterSystems IRIS. For more information, see Consuming WSDLs.

FeedbackOpens in a new tab