apache > ws.apache
Apache Muse
 

Apache Muse - Get WS-Addressing Headers for a Request

You can get access to the WS-Addressing headers that were sent with the current request very easily. As soon as it receives a new request, Muse converts the WS-A headers into Java objects and adds them to the request context. The following code illustrates how to get these values from withing your capability classes:

import org.apache.muse.ws.addressing.*;

...

MessageHeaders wsa = getEnvironment().getAddressingContext();

//
// get EPR of target resource and sender resource
//
EndpointReference myEPR = wsa.getToAddress();
EndpointReference fromEPR = wsa.getFromAddress();

//
// get reference parameters from request
//
QName parameterName = new QName("http://example.com/server-product", "ServerID");
String serverID = myEPR.getParameterString(parameterName);