final SoapService soapService)
throws SoapFault, IOException
{
final String toURI = getDestinationURI(addressingContext) ;
final MessageContext messageContext = createMessageContext(addressingContext) ;
final SoapClient client = getSoapClient(toURI) ;
final SoapBodyMessage soapBodyMessage = new SoapBodyMessage(soapBody, soapDetails, soapService, messageContext) ;
final EndpointReferenceType replyTo = addressingContext.getReplyTo() ;
if (replyTo != null)
{
if (!replyTo.isValid())
{
throw new IOException(WSCLogger.log_mesg.getString("com.arjuna.webservices.wsaddr2005.client.WSAddr2005Client_4")) ;
}
final AttributedURIType address = replyTo.getAddress() ;
if (!AddressingConstants.WSA_ADDRESS_ANONYMOUS.equals(address.getValue()))
{
client.invokeOneWay(soapBodyMessage, toURI) ;
return null ;
}
}
final SoapMessage response = client.invoke(soapBodyMessage, toURI) ;
if (response instanceof SoapBodyMessage)
{
return ((SoapBodyMessage)response).getSoapBody() ;
}
throw new IOException(WSCLogger.log_mesg.getString("com.arjuna.webservices.wsaddr2005.client.WSAddr2005Client_5")) ;