public void handleMessage(SoapMessage message) throws Fault {
if (ContextUtils.isOutbound(message)) {
AddressingProperties maps = ContextUtils.retrieveMAPs(message, false, true, false);
WrappedMessageContext soapContext = new WrappedMessageContext(message, Scope.APPLICATION);
if (soapContext.containsKey(SOAPUtil.SWITCHYARD_CONTEXT)) {
Context context = (Context)soapContext.get(SOAPUtil.SWITCHYARD_CONTEXT);
String property = (String)context.getPropertyValue(SOAPUtil.WSA_ACTION_STR);
AttributedURIType uri = null;
EndpointReferenceType ref = null;
if (property != null) {
uri.setValue(property);
maps.setAction(uri);
}
property = (String)context.getPropertyValue(SOAPUtil.WSA_FROM_STR);
if (property != null) {
uri = new AttributedURIType();
uri.setValue(property);
ref = new EndpointReferenceType();
ref.setAddress(uri);
maps.setFrom(ref);
}
property = (String)context.getPropertyValue(SOAPUtil.WSA_TO_STR);
if (property != null) {
uri = new AttributedURIType();
uri.setValue(property);
ref = new EndpointReferenceType();
ref.setAddress(uri);
maps.setTo(ref);
}
property = (String)context.getPropertyValue(SOAPUtil.WSA_FAULTTO_STR);
if (property != null) {
uri = new AttributedURIType();
uri.setValue(property);
ref = new EndpointReferenceType();
ref.setAddress(uri);
maps.setFaultTo(ref);
}
property = (String)context.getPropertyValue(SOAPUtil.WSA_REPLYTO_STR);
if (property != null) {
uri = new AttributedURIType();
uri.setValue(property);
ref = new EndpointReferenceType();
ref.setAddress(uri);
maps.setReplyTo(ref);
}
property = (String)context.getPropertyValue(SOAPUtil.WSA_RELATESTO_STR);
if (property != null) {
RelatesToType relatesTo = new RelatesToType();
relatesTo.setValue(property);
maps.setRelatesTo(relatesTo);
}
property = (String)context.getPropertyValue(SOAPUtil.WSA_MESSAGEID_STR);
if (property != null) {
uri = new AttributedURIType();
uri.setValue(property);
maps.setMessageID(uri);
}