2 Replies Latest reply on Sep 30, 2010 6:22 AM by MattDares

    Specifying inputs and manipulating outputs of Web Service calls




      I am creating a process in workbench which will take a logged in users id, call a web service to get account information, and then prefill and render a form based on the resultant data. The webservice is an external SOAP webservice, and I am unsure of how to specify a variable as an input to the SOAP request in the process design or how to map the data returned in the soap message into an XML document to use for prefilling the form.


      I saw this link, but am still looking for more insight: http://kb2.adobe.com/cps/499/cpsid_49980.html



        • 1. Re: Specifying inputs and manipulating outputs of Web Service calls
          Steve L Walker Level 5



          I put together a sample that calls a public Web Service, maps the data from the SOAP response to a process variable of type 'xml' and renders a PDF using the xml.


          I found public Web Services at http://wiki.cdyne.com/wiki/index.php?title=CDYNE_Weather which exposes WSDL at http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl and choose the operation GetCityWeatherByZIP. The operation takes a input string of ZIP code and produces the SOAP response, below.



          <?xml version="1.0" encoding="UTF-8"?>

          <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


                <GetCityWeatherByZIPResponse xmlns="http://ws.cdyne.com/WeatherWS/">



                      <ResponseText>City Found</ResponseText>


















          The XML document I am after is the encapsulated in the child GetCityWeatherByZIPResult so I built a schema to express that document.


          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

          <xsd:element name="GetCityWeatherByZIPResult">



             <xsd:element name="Success" type="xsd:string"/>

             <xsd:element name="ResponseText" type="xsd:string"/>

             <xsd:element name="State" type="xsd:string"/>

             <xsd:element name="City" type="xsd:string"/>

             <xsd:element name="WeatherStationCity" type="xsd:string"/>

             <xsd:element name="WeatherID" type="xsd:string"/>

             <xsd:element name="Description" type="xsd:string"/>

             <xsd:element name="Temperature" type="xsd:string"/>

             <xsd:element name="RelativeHumidity" type="xsd:string"/>

             <xsd:element name="Wind" type="xsd:string"/>

             <xsd:element name="Pressure" type="xsd:string"/>

             <xsd:element name="Visibility" type="xsd:string"/>

             <xsd:element name="WindChill" type="xsd:string"/>

             <xsd:element name="Remarks" type="xsd:string"/>







          I then built a PDF, added a data connection to the schema GetCityWeatherByZIP.xsd and added a number of fields bound to the schema. Finally, I got on with building an ES2 process to call the Web Service, extract the GetCityWeatherByZIPResult from the SOAP response and render a PDF using the extracted XML.




          The Web Service settings are depicted below.




          I created an input process variable of type 'string' called zip and added the reference in the Web Service Request using XPath.




          The SetValue service extracts a process variable of type 'xml' called cityWeatherByZIP which I loaded with the schema GetCityWeatherByZIP.xsd. The FormService renderPDFForm then uses the XML cityWeatherByZip to bind to the form. I simply invoked the process from Workbench which creates an output process variable of type 'document' depicted below.




          The LiveCycle ES2 archive is attached.



          • 2. Re: Specifying inputs and manipulating outputs of Web Service calls
            MattDares Level 1

            This was perfect - thank you very much for your effort / input!