{
final AddressingContext responseAddressingContext = AddressingContext.createResponseContext(addressingContext, MessageId.getMessageId()) ;
final String soapBodyAction = response.getAction() ;
if (soapBodyAction != null)
{
responseAddressingContext.setAction(new AttributedURIType(soapBodyAction)) ;
}
AddressingContext.setContext(responseContext, responseAddressingContext) ;
final AttributedURIType to = responseAddressingContext.getTo() ;
if (to != null)
{
if (!to.isValid())
{
if (WSCLogger.arjLoggerI18N.isDebugEnabled())
{
WSCLogger.arjLoggerI18N.debug("com.arjuna.webservices.wsaddr2005.handlers.AddressingInterceptorHandler_4") ;
}
}
else
{
final String toURI = to.getValue() ;
if (!AddressingConstants.WSA_ADDRESS_ANONYMOUS.equals(toURI))
{
if (!AddressingConstants.WSA_ADDRESS_NONE.equals(toURI))
{
try
{
WSAddr2005Client.sendOneWay(response, responseAddressingContext, soapDetails, soapService) ;
}
catch (final IOException ioe)
{
// Something happened while sending an async response so null out the replyTo and throw a fault.
addressingContext.setReplyTo(null) ;
final AnyElement detail = new AnyElement() ;
detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_IRI, responseAddressingContext.getTo())) ;
final NamedElement detailElement = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_DETAIL, detail) ;
final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_DESTINATION_UNREACHABLE,
"Destination unreachable", detailElement) ;
soapFault.setAction(AddressingConstants.WSA_ACTION_FAULT) ;
throw soapFault ;
}
}
return null ;
}
}
}
}
return response ;
}
catch (final SoapFault soapFault)
{
final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
final String soapFaultAction = soapFault.getAction() ;
final String faultAction = (soapFaultAction != null ? soapFaultAction : AddressingConstants.WSA_ACTION_SOAP_FAULT) ;
faultAddressingContext.setAction(new AttributedURIType(faultAction)) ;
final AttributedURIType to = faultAddressingContext.getTo() ;
if (to != null)
{
if (!to.isValid())
{
if (WSCLogger.arjLoggerI18N.isDebugEnabled())
{
WSCLogger.arjLoggerI18N.debug("com.arjuna.webservices.wsaddr2005.handlers.AddressingInterceptorHandler_5") ;
}
}
else
{
final String toURI = to.getValue() ;
if (!AddressingConstants.WSA_ADDRESS_ANONYMOUS.equals(toURI))
{
if (!AddressingConstants.WSA_ADDRESS_NONE.equals(toURI))
{
try