protected boolean handleInbound(MessageContext msgContext)
{
if(log.isDebugEnabled()) log.debug("handleInbound");
SOAPAddressingProperties addrProps = (SOAPAddressingProperties)ADDR_BUILDER.newAddressingProperties();
SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
CommonMessageContext commonMsgContext = (CommonMessageContext)msgContext;
ServerEndpointMetaData serverMetaData = (ServerEndpointMetaData)commonMsgContext.getEndpointMetaData();
AddressingFeature addrFeature = serverMetaData.getFeature(AddressingFeature.class);
if (addrFeature != null && addrFeature.isRequired())
{
try
{
soapMessage.setProperty("isRequired", true);
}
catch (Exception e)
{
//ignore
}
}
addrProps.readHeaders(soapMessage);
msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, addrProps);
msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
msgContext.put(MessageContext.REFERENCE_PARAMETERS, convertToElementList(addrProps.getReferenceParameters().getElements()));
msgContext.setScope(MessageContext.REFERENCE_PARAMETERS, Scope.APPLICATION);
//check if soap action matches wsa action
String[] soapActions = commonMsgContext.getMessageAbstraction().getMimeHeaders().getHeader("SOAPAction");
if (soapActions != null && soapActions.length > 0)
{
String soapAction = soapActions[0];
if (!soapAction.equals("\"\"") && addrProps.getAction() != null)
{
String wsaAction = addrProps.getAction().getURI().toString();
// R1109 The value of the SOAPAction HTTP header field in a HTTP request MESSAGE MUST be a quoted string.
if (!soapAction.equals(wsaAction) && !soapAction.equals("\"" + wsaAction + "\""))
{
try
{
SOAPFault fault = new SOAPFaultImpl();
fault.setFaultCode(new QName(ADDR_CONSTANTS.getNamespaceURI(), "ActionMismatch"));
fault.setFaultString("Mismatch between soap action:" + soapAction + " and wsa action:\""
+ addrProps.getAction().getURI() + "\"");
Detail detail = fault.addDetail();
detail.addDetailEntry(new QName(ADDR_CONSTANTS.getNamespaceURI(), "ProblemAction"));
throw new SOAPFaultException(fault);
}
catch (SOAPException e)