Integration - Web Services

This page is obsolete and available for historical purposes only.


Your Orbeon Forms applications can consume and expose Web services.

Consuming web services

Applications built on Orbeon Forms call Web services using the delegation processor. For example, this is how you would call the famous highway traffic Web service to get the conditions on the 101 highway in California from an XPL:

<p:processor name="oxf:delegation">
<p:input name="interface">
<service id="ca-traffic" type="webservice" endpoint="">
<operation nsuri="urn:xmethods-CATraffic" name="getTraffic"/>
<p:input name="call">
<delegation:execute xmlns:delegation="" service="ca-traffic" operation="getTraffic">
<p:output name="data" id="traffic"/>

The output of that call would be:

<return xmlns:xsi="" xsi:type="xsd:string">
reported as of Wednesday, July 2, 2003 at 16:18 .
Slow for the Cone Zone
US 101

Exposing web services

To expose a Web service, follow these steps:

  1. Declare the Web service in the page-flow.xml, just like a regular page with no view. The Web services will be implemented in an XPL file. The Orbeon Forms example portal features a Web service that sends instant messages to Yahoo! users. It is declared in the page-flow.xml as follows:

    <page path-info="/examples/im" model="oxf:/im/yim-webservice.xpl"/>
  2. To get the SOAP envelope sent to the Web service, use the Request generator and include the path /request/body, specifying the xs:anyURI type for the result. The resuting URI can then be parsed with the URL generator:

    <!-- Extract request body as a URI -->
    <p:processor name="oxf:request">
    <p:input name="config">
    <config xmlns:xs="" stream-type="xs:anyURI">
    <p:output name="data" id="request"/>
    <!-- Dereference URI -->
    <p:processor name="oxf:url-generator">
    <p:input name="config" href="aggregate('config', aggregate('url', #request#xpointer(string(/request/body))))"/>
    <p:output name="data" id="file"/>

    You will find the SOAP envelope sent by the client of your Web service as the resulting file. For example:

    <soapenv:Envelope xmlns:soapenv="" xmlns:SOAP-ENC="" xmlns:xsi="" xmlns:xsd="" soapenv:encodingStyle="">
  3. Generate a SOAP envelope that responds to the client's request and send it to the client with the XML serializer, as follows:

    <p:processor name="oxf:xml-serializer">
    <p:input name="config"><config/></p:input>
    <p:input name="data" href="#response"/>