Table of Contents

Search

  1. Preface
  2. Overview, Downloading, and Installing
  3. Administration API
  4. Identity Service API
  5. Screenflow Programming and SDK
  6. ActiveVOS WSHT API
  7. Embedding Request Forms in Standalone Web Pages
  8. XML-JSON for Process Central

7. APIs, SDKs, and Services

7. APIs, SDKs, and Services

Invoking a Process

Invoking a Process

To invoke a process using a XML binding endpoint, you need to:
  1. Set the POST header content-type header to text/xml
  2. Set the POST payload (body content) to be the request xml element
  3. Include authorization headers if needed
  4. Send an HTTP POST message to the service XML endpoint
The response from the POST will be an HTTP 200/OK response with a content-type of
text/xml.
The response body will contain the service's response XML. The following snippet shows the HTTP request used to invoke the Loan Approval process using the humantaskProcessDemoService service.
POST /active-bpel/services/XML/humantaskProcessDemoService HTTP/1.1 Content-Length: 710 Content-Type: text/xml; charset=UTF-8 Authorization: Basic YWVhZG1pbjphZWFkbWlu Host: localhost:8080 <loan:loanProcessRequest xmlns:loan= "http://schemas.active-endpoints.com/sample/LoanRequest/2008/02/loanRequest.xsd"> <loan:loanType>Automobile</loan:loanType> <loan:firstName>John</loan:firstNam> <loan:lastName>Smith</loan:lastName> <loan:dayPhone>2039299400</loan:dayPhone> <loan:nightPhone>2035551212</loan:nightPhone> <loan:socialSecurityNumber>123-45-6789</loan:socialSecurityNumber> <loan:amountRequested>15000</loan:amountRequested> <loan:loanDescription>Application to finance the purchase of a Toyota Prius</loan:loanDescription> <loan:otherInfo>Down payment is US$7500</loan:otherInfo> <loan:responseEmail>john.smith@example.com</loan:responseEmail> </loan:loanProcessRequest>
The response looks like:
HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Wed, 10 Mar 2010 22:53:40 GMT <loan:status xmlns:loan="http://www.active-endpoints.com/wsdl/humantaskdemo"> Thank you for applying for the Automobile loan for the amount of US$15000. Your loan is currently pending approval. You will receive an email once a decision has been made. </loan:status>
Fault Response
A fault is indicated with an HTTP response code of 500 and whose content-type is
text/xml
(instead of
text/html
or
text/plain
indicating a generic "internal server error"). An example of a fault response is shown here:
HTTP/1.1 500 Internal Server Error Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Thu, 11 Mar 2010 19:09:51 GMT Connection: close <aex:Fault xmlns:aex="http://www.active-endpoints.com/2004/06/bpel/extensions/"> <faultcode name="systemError" namespace="http://www.active-endpoints.com/2004/06/bpel/extensions/"/> <faultstring>Could not find match for Operation from given parameters</faultstring> </aex:Fault>
Attachments
When sending attachments the payload of the HTTP body must be
multipart/related
content, with the first part being the message XML payload (
text/xml
), followed by additional parts representing the attachments. Attachments sent with the payload are bound to the process variable associated with the message
Receive
activity.
POST /active-bpel/services/XML/humantaskProcessDemoService HTTP/1.1 Content-Type: multipart/related; type="text/xml"; start="<part1_id>"; boundary="the_boundry" Content-Length: 1410 MIME-Version: 1.0 Host: localhost:8080 --the_boundry Content-Type: text/xml; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-ID: <part1_id> <loan:loanProcessRequest xmlns:loan= "http://schemas.active-endpoints.com/sample/LoanRequest/2008/02/loanRequest.xsd"> <loan:loanType>Automobile</loan:loanType> <loan:firstName>John</loan:firstName> <loan:lastName>Smith</loan:lastName> <loan:dayPhone>2039299400</loan:dayPhone> <loan:nightPhone>2035551212</loan:nightPhone> <loan:socialSecurityNumber>123-45-6789</loan:socialSecurityNumber> <loan:amountRequested>15000</loan:amountRequested> <loan:loanDescription>Application to finance the purchase of a Toyota Prius</loan:loanDescription> <loan:otherInfo>Down payment is US$7500</loan:otherInfo> <loan:responseEmail>john.smith@example.com</loan:responseEmail> </loan:loanProcessRequest> --the_boundry Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-ID: <part2_id> [...Text Attachment Content...] --the_boundry Content-Type: image/jpeg Content-ID: <part3_id> Content-Transfer-Encoding: BASE64 Content-Description: Picture A [...Image Content...] --the_boundry--
For testing, you can use any HTTP client testing tool available to you. For example, SOAP-UI, cURL (a popular command line tool:
http://curl.haxx.se/
) and RESTClient (see
http://code.google.com/p/rest-client/
), a Java based application to test RESTful web services.