How to access the XML payload of a Service SOAP request as a single property value
A developer asks:
Is there a way to access the XML payload of a Service SOAP rule before the payload is parsed onto the clipboard?
We are running a pure Business Rules Engine (BRE) black-box application -- no flows, no work objects, just a SOAP interface to execute a certain complex calculations and return the result.
We now have the requirement to preserve the incoming XML message as an archived file, before it is parsed by our XML Parse rules.
Similarly, we are required to save the outgoing XML response message as a file, after it is streamed (by our XML rules) but before it leaves Process Commander.
If you are using a Parse XML rule for the input,
- In the SOAP service rule, map the incoming request data to one Single Value property.
- then, call the Parse XML rule from the service activity using the Apply-Parse-XML method.
Similarly, for the response, use method Property-Set-XML to capture the output stream in as the value of a single property. Then map that single property back as the service response.
This approach leaves the incoming request and outgoing response as two property values. These values can be copied into an archival Log- class or another facility that is writes the value out as individual files.