Tuesday, October 9, 2007

How To - 10.1.3 OWSM: Access web service operation name in a custom step

When writing an OWSM policy custom step, you may need to determine what the operation name is for the incoming request. You can use the following API to retrieve the operation name.

MessageContext msgCtxt = (MessageContext) ctx;
String operation = msgCtxt.getRequest().getMethodName();

This will return localpart of the first child element of SOAP Body.
The above API will return Echo as the operation name in the example below.

<env:Envelope ...>
<env:Body ...>
<ns1:Echo xmlns:ns1="http://echoapp">