Mapping SOAP body elements
When you invoke an operation, you can add custom entries to SOAP body elements if the web service requires it.
To create mapping rules for SOAP body data
1. Define Apama events that contain string fields to hold the SOAP body data. For example:
event Stock{
string corrId;
string SOAPbody;
}
event StockValue{
string corrResp;
string resSOAPbody;
}
2. In the adapter editor's Mapping Definitions tab, map the event field string that contains the SOAP body to the operation's SOAP body parameter. The following image shows an input mapping for a SOAP body:
The following image shows an output mapping for a SOAP body:
In this example, you would need to create the SOAP body in EPL or in some other fashion. To use the Web Services Client adapter to build the XML that makes up the SOAP body, you can use the convention-based approach shown in the next few steps. If you use convention-based mapping for SOAP body data then the event you use must correlate one-to-one to the expected SOAP body.
3. Define Apama events such as the following. In this example, the _GetStockDailyValue event contains the SOAP body data.
event _GetStockDailyValue{
string strStockExchange;
string strStock;
string strDate;
}
event GetStockDailyValueInput{
_GetStockDailyValue GetStockDailyValue;
}
event _GetStockDailyValueResponse{
float GetStockDailyValueResult;
}
event GetStockDailyValueOutput{
_GetStockDailyValueResponse GetStockDailyValueResponse;
}
4. In the Input tab of the Event Mappings tab, right-click the event that contains the SOAP body data. In this example, this is _GetStockDailyValue field. Select Add Computed Node and click OK. The Add Computed Node dialog appears.
5. In the Add Computed Node dialog's Select Method field, select Convert to XML from the drop-down list and click OK.
6. Map the <Custom>apamaEvent that contains the SOAP body to the operation's parameters field. For example, the input mapping might look like this:
The output mapping might look like this: