Archive for September, 2008

WebService calls with XML Documents, CDATA sections

For this sample we will create 2 processes to demonstrate how to call a webservice passing a Document to/from the webservice.  The process xml file is also attached to the page and can be imported into workbench as well as the complete application(LCA).  A WSDL that uses the xml type for a return document causes the xml document to be inserted into the SOAP response into a CDATA section in the response:

<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance“>
   <soapenv:Body>
      <invokeResponse xmlns=”http://adobe.com/idp/services“>
         <outDoc xmlns:ns1=”http://adobe.com/idp/services” xsi:type=”ns1:XML”>
            <document><![CDATA[<?xml version=”1.0″?>
<ns1:BankResponse decisionServiceName=”anti_fraud” xmlns:ns1=”urn:Bank”>
 ….

</document>
         </outDoc>
      </invokeResponse>
   </soapenv:Body>
</soapenv:Envelope>

 The WebService Service takes these CDATA sections and places them into a list of documents as a return type.  If there are 4 CDATA sections, there will be 4 documents returned in the CDATA list variable.  This allows calling wsdls that return XML documents.  In this example, we will create 2 Processes.  One is the service to return an xml document and the other is the calling webservice

Create a process to be used as a webservice(you may also import the attached application.lca):

  1. In workbench, create a new short lived process called echoXmlDoc.  This process will need one output variable of type xml.  This example uses the names outDoc for the output Document.
  2. Drag in the Read Resource Content service.  This will be the only Step needed in your process.
  3. Double click on the service and for the input choose the xml file to read.  This example uses /mini.xml.
  4. For the output, map the result variable to outDoc.
  5. Save and activate the process.  You should now be able to see the WSDL at http://localhost:8080/soap/services/echoXmlDoc?wsdl  if on a JBoss server, or change the port if another app server is used.

Create the process to call a webservice

 

  1. Create a short lived process called for the webservice call with the following variables:
  2.  
  3. As the first step in the process, drag in the WebServices Service.  Double Click on the WebService icon to bring up the properties pane.  Set the Web Service response variables for Response to the variable responseXml and CDATA list to the variable attachments.  In the Web Service Options tab, click on the (…) next to options to setup the webService call:
  4. You will need to load the WSDL URL for the service create above (http://localhost:8080/soap/services/echoXmlDoc?wsdl) and chose load wsdl.  You may also have to set the user name and password to invoke the service, by default the ES WSDLs are secure. 
  5. Next, Click on the request tab, Genereate the SOAP Request.  This will generate the SOAP Request with all the available parameters.  Note that you can also generate the SOAP request for the test and use the test tab to test your request:
  6. We can now chose OK to exit out of the Web Service Options
  7. Next, Drag in the Set Value Service after the Web Service.  Double click on Set Value service to bring up the properties page.  We need to map the output document to the first document in the attachments list.  This is done by setting the location /process_data/@outDoc to the expression /process_data/attachments[1]

 

Webservice-calls-with-xml-documents with Application and Process Files

September 10, 2008 at 6:40 pm Leave a comment

WebService calls using MIME attachments

For this sample we will create 2 processes to demonstrate how to call a webservice passing a Document to/from the webservice using MIME attachments.  The process xml file is also attached to the page and can be imported into workbench.  There is also a complete application(LCA) in the same document.

Create a process to be used as a webservice:

  1. In workbench, create a new short lived process called echoDoc.  This process will need 1 input variable of type Document and one output variable of type Document.  This example uses the names inDoc for the input Document and outDoc for the output Document.
  2. Drag in the Set Value service.  This will be the only Step needed in your process.
  3. Double click on the Set Value service in your process, and select the ‘+’ for a new mapping.  You will need to map the location of the output document to the input document.  Set the location: /process_data/@outDoc to the Expression /process_data/@inDoc.  This simply “echos” the document passed in.
  4. Save and activate the process.  You should now be able to see the WSDL at http://localhost:8080/soap/services/echoDoc?wsdl  if on a JBoss server, or change the port if another app server is used.

Create the process to call a webservice passing documents as MIME attachments

 

  1. Create a short lived process called for the webservice call with the following variables:
  2. As the first step in the process, drag in the WebServices Service.  Double Click on the WebService icon to bring up the properties pane.  Set the Web Service response variables for Response to the variable responseXml and Attachments to the variable attachments.  In the Web Service Options tab, click on the (…) next to options to setup the webService call:
  3. You will need to load the WSDL URL for the service create above (http://localhost:8080/soap/services/echoDoc?wsdl) and chose load wsdl.  You may also have to set the user name and password to invoke the service, by default the ES WSDLs are secure.  You also need to append ?blob=mime to the target URL to tell ES to return the document in MIME.  See the link for the technote below for a description of these options.
  4. Next, Click on the request tab, select Include optional and Genereate the SOAP Request.  This will generate the SOAP Request with all the available parameters.  We will need to only fill in the values for attachmentID and remove the extra Optional elements. We will set attachmentID to part0 as  <ser:attachmentID>part0</ser:attachmentID>:
  5. Next, click on the attachments tab and choose Load Attachment Parts.  This will call the ES WSDL and show the types available.  The attachment parts are labeled part0..partN for each attachment.  In this case we have one attachment which is labeled part0, which is the name name we used in the request above.  We will also need to map this to our input document /process_data/@inDoc.  Do this by clickin on the (…) in the attachment row of part0.  We can now chose OK to exit out of the Web Service Options:
  6. Next, Drag in the Set Value Service after the Web Service.  Double click on Set Value service to bring up the properties page.  We need to map the output document to the first document in the attachments list.  This is done by setting the location /process_data/@outDoc to the expression /process_data/attachments[1]

 

There is also a technote kb403973 on attachments at http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403973&sliceId=1

 

 Webservice-calls-using-mime Attachment with Application and Process Files

September 10, 2008 at 5:04 pm Leave a comment


Calendar

September 2008
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Posts by Month

Posts by Category


Design a site like this with WordPress.com
Get started