Call SOAP service using locally available WSDL

Certified Lead Developer

Hello Appian practitioners, 

Following the notes from this discussion,

I tried creating a WEB-API to load a locally available WSDL within the 'Call Web Service' smart service.

My web-api returns the following httpResponse

a!httpResponse(
/*
* Set an HTTP header that tells the client that the body of the response
* will be a CSV attachment.
*/
headers: {
a!httpHeader(
name: "Content-Disposition",
value: "attachment; filename=" & char(34) & local!username & ".xml" & char(34)
)
},
/*
* Create a CSV value of 'local!user' and place it in the response body.
*/
body: rule!TS_test_ProfileXML() /* XML Contents */
)

However, the call web-service is still not able to detect the WSDL. 

Appreciate all your help!

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to Stefan Helzle

    Yes, I did try adding the content-type and removing content-disposition, but without success.

    Would you recommend any other way of consuming the local wsdl file?

  • 0
    Certified Lead Developer
    in reply to TJ

    Did you test your API using Postman or SoapUI?

    AFAIK there is no simple way to use a local WSDL.

  • 0
    Certified Lead Developer
    in reply to Stefan Helzle

    The original WSDL is hosted on an internal server connected via VPN. 

    All I want to do is to change the soap address location to the latest server and call the new SOAP WSDL.

    Any idea if I can do that using Appian's WEB-API? Or shall I host the XML on a different server?

  • 0
    Certified Lead Developer
    in reply to TJ

    Hi Stefan,

    I have seen your older discussion here where you've recommended using Web-api. If possible, can you share a sample code with me?

  • 0
    Certified Lead Developer
    in reply to TJ

    By any chance, the error message you got is already more specific as it complains about the WSDL version. Could it be that the WSDL is somehow malformed?

  • 0
    Certified Lead Developer
    in reply to Stefan Helzle

    The same WSDL is also hosted at a local server which Appian can read. But not the one that I updated and hosted on Appian (web-API)

    I am only updating an HTTP URL within the WSDL. 

    Appian logs suggest the following

  • 0
    Certified Lead Developer
    in reply to TJ

    I also tried copying the entire XML from a public WSDL 'https://www.dataaccess.com/webservicesserver/NumberConversion.wso' but still the same issue

  • +1
    Certified Lead Developer
    in reply to TJ

    Did a quick test with the XML of the WSDL from your example copied to a text constant. This works without any issues. Could it be that the security settings for the API are not correct?

  • 0
    Certified Lead Developer
    in reply to Stefan Helzle

    I am using the system admin account but it still fails.

    First of all, thank you so much for testing it at your end. 

    And if possible, could you please validate if the content of your cons!TST_WSDL is the same as attached?

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://www.dataaccess.com/webservicesserver/" name="NumberConversion" targetNamespace="http://www.dataaccess.com/webservicesserver/">
      <types>
        <xs:schema elementFormDefault="qualified" targetNamespace="http://www.dataaccess.com/webservicesserver/">
          <xs:element name="NumberToWords">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="ubiNum" type="xs:unsignedLong"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="NumberToWordsResponse">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="NumberToWordsResult" type="xs:string"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="NumberToDollars">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="dNum" type="xs:decimal"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="NumberToDollarsResponse">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="NumberToDollarsResult" type="xs:string"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:schema>
      </types>
      <message name="NumberToWordsSoapRequest">
        <part name="parameters" element="tns:NumberToWords"/>
      </message>
      <message name="NumberToWordsSoapResponse">
        <part name="parameters" element="tns:NumberToWordsResponse"/>
      </message>
      <message name="NumberToDollarsSoapRequest">
        <part name="parameters" element="tns:NumberToDollars"/>
      </message>
      <message name="NumberToDollarsSoapResponse">
        <part name="parameters" element="tns:NumberToDollarsResponse"/>
      </message>
      <portType name="NumberConversionSoapType">
        <operation name="NumberToWords">
          <documentation>Returns the word corresponding to the positive number passed as parameter. Limited to quadrillions.</documentation>
          <input message="tns:NumberToWordsSoapRequest"/>
          <output message="tns:NumberToWordsSoapResponse"/>
        </operation>
        <operation name="NumberToDollars">
          <documentation>Returns the non-zero dollar amount of the passed number.</documentation>
          <input message="tns:NumberToDollarsSoapRequest"/>
          <output message="tns:NumberToDollarsSoapResponse"/>
        </operation>
      </portType>
      <binding name="NumberConversionSoapBinding" type="tns:NumberConversionSoapType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="NumberToWords">
          <soap:operation soapAction="" style="document"/>
          <input>
            <soap:body use="literal"/>
          </input>
          <output>
            <soap:body use="literal"/>
          </output>
        </operation>
        <operation name="NumberToDollars">
          <soap:operation soapAction="" style="document"/>
          <input>
            <soap:body use="literal"/>
          </input>
          <output>
            <soap:body use="literal"/>
          </output>
        </operation>
      </binding>
      <binding name="NumberConversionSoapBinding12" type="tns:NumberConversionSoapType">
        <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="NumberToWords">
          <soap12:operation soapAction="" style="document"/>
          <input>
            <soap12:body use="literal"/>
          </input>
          <output>
            <soap12:body use="literal"/>
          </output>
        </operation>
        <operation name="NumberToDollars">
          <soap12:operation soapAction="" style="document"/>
          <input>
            <soap12:body use="literal"/>
          </input>
          <output>
            <soap12:body use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="NumberConversion">
        <documentation>The Number Conversion Web Service, implemented with Visual DataFlex, provides functions that convert numbers into words or dollar amounts.</documentation>
        <port name="NumberConversionSoap" binding="tns:NumberConversionSoapBinding">
          <soap:address location="https://www.dataaccess.com/webservicesserver/NumberConversion.wso"/>
        </port>
        <port name="NumberConversionSoap12" binding="tns:NumberConversionSoapBinding12">
          <soap12:address location="https://www.dataaccess.com/webservicesserver/NumberConversion.wso"/>
        </port>
      </service>
    </definitions>
    

  • 0
    Certified Lead Developer
    in reply to TJ

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://www.dataaccess.com/webservicesserver/" name="NumberConversion" targetNamespace="http://www.dataaccess.com/webservicesserver/">
      <types>
        <xs:schema elementFormDefault="qualified" targetNamespace="http://www.dataaccess.com/webservicesserver/">
          <xs:element name="NumberToWords">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="ubiNum" type="xs:unsignedLong"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="NumberToWordsResponse">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="NumberToWordsResult" type="xs:string"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="NumberToDollars">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="dNum" type="xs:decimal"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="NumberToDollarsResponse">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="NumberToDollarsResult" type="xs:string"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:schema>
      </types>
      <message name="NumberToWordsSoapRequest">
        <part name="parameters" element="tns:NumberToWords"/>
      </message>
      <message name="NumberToWordsSoapResponse">
        <part name="parameters" element="tns:NumberToWordsResponse"/>
      </message>
      <message name="NumberToDollarsSoapRequest">
        <part name="parameters" element="tns:NumberToDollars"/>
      </message>
      <message name="NumberToDollarsSoapResponse">
        <part name="parameters" element="tns:NumberToDollarsResponse"/>
      </message>
      <portType name="NumberConversionSoapType">
        <operation name="NumberToWords">
          <documentation>Returns the word corresponding to the positive number passed as parameter. Limited to quadrillions.</documentation>
          <input message="tns:NumberToWordsSoapRequest"/>
          <output message="tns:NumberToWordsSoapResponse"/>
        </operation>
        <operation name="NumberToDollars">
          <documentation>Returns the non-zero dollar amount of the passed number.</documentation>
          <input message="tns:NumberToDollarsSoapRequest"/>
          <output message="tns:NumberToDollarsSoapResponse"/>
        </operation>
      </portType>
      <binding name="NumberConversionSoapBinding" type="tns:NumberConversionSoapType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="NumberToWords">
          <soap:operation soapAction="" style="document"/>
          <input>
            <soap:body use="literal"/>
          </input>
          <output>
            <soap:body use="literal"/>
          </output>
        </operation>
        <operation name="NumberToDollars">
          <soap:operation soapAction="" style="document"/>
          <input>
            <soap:body use="literal"/>
          </input>
          <output>
            <soap:body use="literal"/>
          </output>
        </operation>
      </binding>
      <binding name="NumberConversionSoapBinding12" type="tns:NumberConversionSoapType">
        <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="NumberToWords">
          <soap12:operation soapAction="" style="document"/>
          <input>
            <soap12:body use="literal"/>
          </input>
          <output>
            <soap12:body use="literal"/>
          </output>
        </operation>
        <operation name="NumberToDollars">
          <soap12:operation soapAction="" style="document"/>
          <input>
            <soap12:body use="literal"/>
          </input>
          <output>
            <soap12:body use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="NumberConversion">
        <documentation>The Number Conversion Web Service, implemented with Visual DataFlex, provides functions that convert numbers into words or dollar amounts.</documentation>
        <port name="NumberConversionSoap" binding="tns:NumberConversionSoapBinding">
          <soap:address location="https://www.dataaccess.com/webservicesserver/NumberConversion.wso"/>
        </port>
        <port name="NumberConversionSoap12" binding="tns:NumberConversionSoapBinding12">
          <soap12:address location="https://www.dataaccess.com/webservicesserver/NumberConversion.wso"/>
        </port>
      </service>
    </definitions>