SOAP Inbound Service

The SOAP Inbound service handles SOAP requests and responses. The service uses the URI that the document was posted to set the business process that should be invoked to handle the request.

The following table provides an overview of the Simple Object Access Protocol (SOAP) Inbound service:

Category Description
System Name SOAPInbound
Graphical Process Modeler (GPM) categories) All Services, Internet B2B > SOAP
Description SOAP is an XML-based protocol that allows access to services, objects, and servers in a platform-independent manner. The SOAP Inbound Service is responsible for handling SOAP requests and responses. For SOAP requests, the service uses the URI to which the document was posted to set the business process that should be invoked to handle the request. The service also adds any SOAP headers targeted at it to process data, removes the SOAP enveloping from the request, and makes the SOAP payload the primary document. For SOAP responses, the services checks to see if it is expecting a SOAP response, and if it is, extracts the payload and makes it the primary document. It also checks to see if a SOAP Fault is present. If one is present, the service sets the workflow status to error.
Business usage Processes inbound SOAP messages.
Usage example Examples:
  • To receive SOAP messages, see HandleSOAPRequest Business Process.
  • To send SOAP messages, see SendSOAPRequest Business Process.
Preconfigured? No. A configuration of the service, SOAPInbound, is installed with the application, but you must edit the service and define URIs for the service to use.
Requires third-party files? No
Platform availability All supported application platforms
Related services
Related services:
  • SOAP Outbound service
  • HTTP Server adapter
  • HTTP Client adapter
Note: The HTTP Server adapter and HTTP Client adapter replace the B2B HTTP Server adapter and HTTP Send service, which has entered the retirement process. For more information, see Services and Adapters in the Retiring Category.
Application requirements None
Initiates business processes? Yes, you can specify a business process to start when a SOAP message is received.
Invocation To invoke this service in the predefined business process called HandleSOAPRequest, configure an HTTP Server adapter with a URI mapped to the HandleSOAPRequest business process, specifying raw messages.
Business process context considerations None
Returned status values
Returned status values:
  • Success – Request or Response was handled without errors.
  • Error – Errors were encountered somewhere in the SOAP document, and the advanced status will be set to SOAP-FAULT.
Restrictions None
Testing considerations Use the predefined business processes HandleSOAPInbound and SendSOAPRequest to test the service configuration.
Notes Output parameters are:
  • bootstrap - Specifies whether bootstrap mode is used. This decides if we are processing a SOAP request or SOAP response. Valid values for this parameter are:
    • true - Process a SOAP request.
    • false - Process a SOAP response.
    Default is true.
  • SOAP_URI – The URI to which the message was posted (bootstrap mode only).
  • NextSoapURL – Where the message should be sent next (if intermediate mode and bootstrap mode).
  • ReceivedSOAPHeaders – The node containing the SOAP headers targeted at the service.
  • SOAPfaultcode – Could be present if a SOAP fault was encountered.
  • SOAPfaultstring – Could be present if a SOAP fault was encountered.
  • SOAP_INTERMEDIATE_NODE – “true” if the URI configuration says to act as an intermediate node.
  • WFD_NAME – The definition name of the business process to invoke to actually handle the SOAP payload.
  • SOAPActor – The SOAPActor specified in the configuration for the URI.

Implementing the SOAP Inbound Service

To implement the SOAP Inbound service:
  1. Before you configure the SOAP Inbound service, configure a corresponding HTTP Server adapter. When you configure the HTTP Server adapter:
    • Use the same Uniform Resource Indicator (URI) that you will use in the SOAP Inbound service.
    • Specify Raw Messages
    • For the business process, specify HandleSOAPRequest.
      Note: The HTTP Server adapter and HTTP Client adapter replace the B2B HTTP Server adapter and HTTP Send service, which has entered the retirement process. For more information, see Services and Adapters in the Retiring Category.
  2. Create a SOAP Inbound service configuration, or edit the SOAP Inbound service configuration supplied with the application.
    Note: If you create a new configuration, you must also create new copies of the predefined business processes, HandleSOAPRequest.bp and SendSOAPRequest.bp, and edit them to use the new service configuration.
  3. Configure the SOAP Inbound service. See Configuring the SOAP Inbound Service.
  4. Configure one or more of the predefined SOAP business processes to enable the application to receive or send SOAP messages.
    • To receive SOAP messages, see HandleSOAPRequest Business Process.
    • To send SOAP messages, see SendSOAPRequest Business Process.

Configuring the SOAP Inbound Service

To configure the SOAP Inbound service, you must specify settings for the following fields in the application:

Field Description
Name Unique and meaningful name for the adapter configuration. Required.
Description Meaningful description for the adapter configuration, for reference purposes. Required.
Select a Group Select one of the options:
  • None – You do not want to include this configuration in a group at this time.
  • Create New Group – You can enter a name for a new group in this field, which will then be created along with this configuration.
  • Select Group – If you have already created one or more groups for this service type, they are displayed in the list. Select a group from the list.
URI Universal resource identifier (URI) where others can post SOAP messages to the application. For each URI in the SOAP Inbound service, you must have corresponding URIs defined in an HTTP Server adapter.
Is this an intermediate node? Whether the application is the ultimate receiver.

Valid values are Yes and No.

Business Process Business process to run when the application receives a SOAP message.
Note: Do not select HandleSOAPRequest because the SOAP Inbound service runs as a result of that business process.
Actor Unique name that identifies the application as a unique node. This is usually a URL.
Payload Root Tag Valid XML tag that contains multiple payloads as if they were one payload.
Forward To URL of the next node, if the application is an intermediate node.
Verify signature with the certificate System certificate to verify the signature.
Expect signed messages? Whether you expect to receive SOAP messages that are digitally signed.

Valid values are Yes and No.

If you receive a message with a certificate expecting a signature and you do not receive a signature, the application generates a SOAP fault message. Also, if you receive a SOAP message with a signature, whether or not it is expected, and the signature does not verify, the application generates a SOAP fault.

The following table describes the fields used to configure a header for the SOAP Inbound service in the application:

Field Description
Header Header that the application can process. Add a new header for each header that the application accepts.
Namespace Namespace that is related to the header.

HandleSOAPRequest Business Process

The HandleSOAPRequest business process enables the application to receive SOAP messages.

When HandleSOAPRequest receives a SOAP message, it validates and reads the message to determine the receiver of the message. If the application is the receiver of the message, HandleSOAPRequest completes the following process:
  1. Verifies the digital signature.
  2. Removes the SOAP envelope and puts any attachments and SOAP header blocks into process data. The application puts inbound SOAP message attachments in process data under the node SOAPRequestAttachments. The attachments follow this naming convention: SOAPAttachment1, SOAPAttachment2, and so on. The application sets the content ID attribute to what was specified in the SOAP message. For details, see Handling Multiple Incoming Attachments.
  3. Starts subprocesses associated with the URI to which the inbound message was sent (configured in the SOAP Inbound service).
  4. Applies a SOAP envelope, if necessary, and HTTP headers to the document.
  5. Returns a response to the requester.
If the application is not the receiver of the message, HandleSOAPRequest completes the following process:
  1. Verifies the digital signature.
  2. Removes SOAP header blocks that are specific to the application and puts them into process data.
  3. Forwards a document to the next receiver.
  4. Receives a response from the receiver.
  5. Returns a response to the requester.
Before you use the HandleSOAPRequest business process, you must complete the following tasks:
  • Configure the SOAP Inbound service.
  • Configure a related B2B HTTP Server adapter so that it:
    • Uses raw messages
    • Specifies the same URI as the SOAP Inbound service
    • Specifies the HandleSOAPRequest business process
  • Create the business process that processes the SOAP message where the application is the receiver of the message. Depending on your needs, you may need to assign values to several parameters in this business process before using the HandleSOAPRequest business process.

    The following table identifies parameters for various SOAP functions and the values you may need to specify:

    Required SOAP Function SOAP Parameter Parameter Values
    SOAP enveloping on primary document before posting response ADD_SOAP_ENVELOPING true– Add SOAP enveloping (default).
    Digitally sign a SOAP response SIGN_WITH_KEY Exact name of the digital certificate
    Envelope namespace prefix for SOAP message SOAPEnvNSPrefix Envelope namespace prefix. ADD_SOAP_ENVELOPING must also be true. The default is SOAP_ENV.
    Distinguish whether response is a SOAP message RESPOND_NON_SOAP true – Response is not a SOAP message.

    false – Response is a SOAP message.

    Envelope namespace for SOAP message SOAPEnvNSURI Envelope namespace. The default is http://www.w3.org/2001/06/soap-envelope.

Business Process Example – HandleSOAPRequest

The following is the predefined HandleSOAPRequest business process, as delivered with the application:

<process name="HandleSOAPRequest">
 <rule name="acting_as_intermediate">
   <condition>SOAP_INTERMEDIATE_NODE = "true"</condition>
 </rule>
  <rule name="acting_as_endpoint">
   <condition>SOAP_INTERMEDIATE_NODE = "false"</condition>
 </rule>
  <sequence>
   <sequence>
      <operation name="SoapIn">
       <participant name="SOAPInbound"/>
       <output message="output">
         <assign to="." from="*"></assign>
       </output>
        <input message="input">
         <assign to="." from="*"></assign>
       </input>
      </operation>
     <onFault code="SOAP-FAULT">
       <assign to="InvokeSubBP">false</assign>
     </onFault>
     <choice>
        <select>
         <case ref="acting_as_intermediate" activity="act_as_intermediate"/>
       </select>
       <sequence name="act_as_intermediate">
         <assign to="xport-http-url" from="NextSoapURL/text()"></assign>
         <assign to="b2b-message-mode">send</assign>
         <sequence>
            <operation name="HTTPSend">
              <participant name="SOAP_HTTP_Send"/>
              <output message="Xout">
                <assign to="b2b-raw-response">true</assign>
               <assign to="." from="*"></assign>
             </output>
              <input message="Xin">
                <assign to="." from="*"></assign>
             </input>
            </operation>
           <onFault>
              <sequence>
               <assign to="SOAPfaultcode">Server</assign>
               <assign to="SOAPfaultstring">There was an error processing the 
                           SOAP request.</assign>
               <assign to="SOAPdetail">An error occurred trying to send SOAP 
                           request to next node.</assign>
             </sequence>
            </onFault>
         </sequence>
         <operation name="SoapIn">
         <participant name="SOAPInbound"/>
           <output message="output">
             <assign to="." from="*"></assign>
             <assign to="bootstrap">false</assign>
           </output>
            <input message="input">
              <assign to="." from="*"></assign>
            </input>
         </operation>
         <assign to="SOAPOutboundAttachments" from="SOAPResponseAttachments/*"/>
        </sequence>
     </choice>
     <choice>
        <select>
         <case ref="acting_as_endpoint" activity="act_as_endpoint"/>
       </select>
       <sequence name="act_as_endpoint">
         <operation>
            <participant name="InvokeBusinessProcessService"/>
           <output message="Xout">
             <assign to="." from="*"></assign>
             <assign to="INVOKE_MODE">SYNC</assign>
           </output>
            <input message="Xin" >
              <assign to="." from="*"></assign>
            </input>
         </operation>
         <onFault>
            <sequence>
             <assign to="SOAPfaultcode">Server</assign>
             <assign to="SOAPfaultstring">There was an error processing the 
                         SOAP request.</assign>
             <assign to="SOAPdetail">An error occurred while processing the 
                         SOAP request.</assign>
           </sequence>
          </onFault>
       </sequence>
      </choice>
   </sequence>
            
   <operation name="SoapOut">
      <participant name="SOAPOutbound"/>
      <output message="output">
       <assign to="." from="*"></assign>
       <assign to="SOAP_MODE">respond</assign>
     </output>
      <input message="input">
       <assign to="." from="*"></assign>
     </input>
    </operation>
   <assign to="doc-has-headers">true</assign>
   
    <operation name="HttpResponse">
     <participant name="HttpRespond"/>
     <output message="Xout">
        <assign to="." from="*"></assign>
      </output>
     <input message="Xin">
        <assign to="." from="*"></assign>
      </input>
   </operation>
 </sequence> 
</process>

The following illustrations show the business process as it appears in the GPM:

HandleSOAPRequest Screen 1 of 4

HandleSOAPRequest Screen 2 of 4

HandleSOAPRequest Screen 3 of 4

HandleSOAPRequest Screen 4 of 4

SendSOAPRequest Business Process

The SendSOAPRequest business process enables the application to send SOAP messages.

When the application sends a SOAP message, SendSOAPRequest completes the following process:
  1. Applies a SOAP envelope to the data, if requested.
  2. Adds SOAP headers to an outbound request if the process data contains SOAP headers. The business process takes all subordinate nodes under the SOAPHeaders node in process data and adds them as SOAP header blocks.
  3. Adds SOAP attachments to an outbound request if the process data contains SOAP outbound attachments. The business process takes all subordinate nodes under the SOAPAttachments node, which are named SOAPAttachment1, SOAPAttachment2, and so on. These nodes must have a ContentID attribute specified, as well.
  4. Sends the SOAP message to a receiver using HTTP.
  5. Receives a response.
  6. Acknowledges a response.
  7. Provides a response to another business process in the application.
Before you use the SendSOAPRequest business process, you must complete the following tasks:
  • Create a SOAP Outbound service configuration with a name and description.
  • Create a separate business process for each SOAP service you want the application to call.

    The business process must complete the following tasks:

    • Assign a value to SOAPRequestURL. The value is the URL to which the application should post the SOAP request.
    • Perform an operation with InvokeBusinessProcessService as the participant, assigning SendSOAPRequest to the WDF_NAME parameter.
  • Depending on your needs, assign values to other parameters before using the SendSOAPRequest business process.

The following table identifies parameters for various SendSOAP functions and the values you may need to specify in your business process:

Required SOAP Function SOAP Parameter Parameter Value
SOAPAction HTTP header must be present SOAP_ACTION HTTP header.
SOAP enveloping on primary document before posting ADD_SOAP_ENVELOPING true – Add SOAP enveloping (default).

false – No SOAP enveloping.

Digitally sign a SOAP message SIGN_WITH_KEY Exact name of the digital certificate.
Envelope namespace prefix for SOAP message SOAPEnvNSPrefix Envelope namespace prefix. ADD_SOAP_ENVELOPING must also be true. The default is SOAP_ENV.
Distinguish whether expected response is a SOAP message SOAP_RESPONSE_NON_ SOAP true – Response is not a SOAP message.

false – Response is a SOAP message. Default.

Verify a SOAP response that has been digitally signed VERIFY_WITH_KEY Name of the public key. Specify this value before you use the SendSOAPRequest business process if you expect a signature on the SOAP response.
Must use a proxy server xport-tp-proxyauth The following information in this format: IP address,port number,username,password. User name and password may not be required.
Envelope namespace for SOAP message SOAPEnvNSURI Envelope namespace. The default is http://www.w3.org/2001/06/soap-envelope.

Business Process Example – SendSOAPRequest

The following is the predefined SendSOAPRequest business process, as delivered with the application:

<process name="SendSOAPRequest">
 <sequence>
    <operation name="SoapOut">
      <participant name="SOAPOutbound"/>
     <output message="BPML:output">
       <assign to="." from="*"></assign>
     </output>
      <input message="input">
       <assign to="." from="*"></assign>
     </input>
    </operation>
   <operation name="HTTPSend">
      <participant name="SOAP_HTTP_Send"/>
      <output message="Xout">
       <assign to="b2b-raw-response">true</assign>
       <assign to="." from="*"></assign>
     </output>
      <input message="Xin">
       <assign to="." from="*"></assign>
     </input>
    </operation>
   <operation name="SoapIn">
      <participant name="SOAPInbound"/>
      <output message="BPML:output">
       <assign to="." from="*"></assign>
       <assign to="bootstrap">false</assign>
     </output>
      <input message="input">
       <assign to="." from="*"></assign>
     </input>
    </operation>
 </sequence> 
</process>

The following illustration shows the business process as it appears in the GPM:

Handling Multiple Incoming Attachments

When the SOAP Inbound Service handles a SOAP request containing attachments, the message package is opened and the SOAP payload and all attachments are placed in Process Data. The SOAP payload becomes the primary documeent, and the attachments are added with keys being SOAPAttachment1 . . . SOAPAttachmentn. These attachments are located under a SOAPAttachments tag in process data, and their nodes will contain attributes for Content Location and/or Content ID, if these values exist in the SOAP message package. An example Process Data section is shown below for a SOAP message containing two attachments:

<ProcessData> 
... 
<SOAP_URI>/ws/soap/testattachments </SOAP_URI> 
<SOAP_INTERMEDIATE_NODE>false</SOAP_INTERMEDIATE_NODE> 
<WFD_NAME>ExtractSOAPAttachments</WFD_NAME> 
<SOAPAttachments>
    <SOAPAttachment1 Content-ID='cid:http://productheaven.com/234sdaim3324.xml'
      Content-Location='http://productheaven.com/234sdaim3324.xml'
      SCIObjectID='neith:4aedaa:eb9e01efbe:-7d3e'/>
   <SOAPAttachment2 Content-ID='cid:http://productheaven.com/3874923874.xml'
     Content-Location='http://productheaven.com/3874923874.xml' 
     SCIObjectID='neith:4aedaa:eb9e01efbe:-7d3c'/> 
</SOAPAttachments> 
<SOAP-ENV:ReceivedSOAPHeaders>
    <abc:Extension2 s:mustUnderstand='0' xmlns:abc=
         'http://example.org/2001/06/ext'/> 
</SOAP-ENV:ReceivedSOAPHeaders> 
<PrimaryDocument SCIObjectID='neith:4aedaa:eb9e01efbe:-7d3a'/> 
</ProcessData>

Accessing the SOAP Payload and Attachments in Process Data.

The SOAP payload is the primary document, but to work on an attached document that is referenced by the primary document, additional steps must be taken. Essentially, we want to make the referenced attachment the new primary document. See the following example SOAP payload:

<Products>
   <product href="cid:http://productheaven.com/234sdaim3324.xml"/>
   <product href="cid:http://productheaven.com/3874923874.xml"/> 
</Products>

First, use the XML Encoder service to put the actual contents of the soap payload into process data. Then use an assign statement to make a referenced attachment the new primary document.

Note: You might also want to save the existing primary document for later access. That can be done with an assign such as <assign to="OldPrimary" from="/ProcessData/PrimaryDocument" />)

The xpath expression would be:

<assign to="PrimaryDocument" 
              from="SOAPAttachments/*[@Content-ID=//product[1]/ 
                    @href/text()]/@SCIObjectID"
        />

This xpath expression says to set the primary document to the node under SOAPAttachments having a content ID attribute value that matches the href attribute value of the first occurrence of “product” in process data. You can perform whatever operations are needed on that attachment.

To make the old primary document the current primary document again, use a statement such as:

<assign to="." from="/ProcessData/OldPrimary/PrimaryDocument" 
           append="false"/>