* @return Returns MessageContext.
* @throws AxisFault
*/
public MessageContext send(MessageContext msgctx, TransportInDescription transportIn)
throws AxisFault {
AxisEngine engine = new AxisEngine(msgctx.getConfigurationContext());
engine.send(msgctx);
// create the responseMessageContext
MessageContext responseMessageContext = new MessageContext();
responseMessageContext.setConfigurationContext(msgctx.getConfigurationContext());
responseMessageContext.setSessionContext(msgctx.getSessionContext());
responseMessageContext.setTransportIn(msgctx.getTransportIn());
responseMessageContext.setTransportOut(msgctx.getTransportOut());
responseMessageContext.setProperty(MessageContext.TRANSPORT_IN,
msgctx.getProperty(MessageContext.TRANSPORT_IN));
msgctx.getAxisOperation().registerOperationContext(responseMessageContext, msgctx.getOperationContext());
responseMessageContext.setServerSide(false);
responseMessageContext.setServiceContext(msgctx.getServiceContext());
responseMessageContext.setServiceGroupContext(msgctx.getServiceGroupContext());
// If request is REST we assume the responseMessageContext is REST, so set the variable
responseMessageContext.setDoingREST(msgctx.isDoingREST());
SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(responseMessageContext,
msgctx.getEnvelope().getNamespace().getName());
if (resenvelope != null) {
responseMessageContext.setEnvelope(resenvelope);
engine = new AxisEngine(msgctx.getConfigurationContext());
engine.receive(responseMessageContext);
} else {
throw new AxisFault(Messages.getMessage("blockingInvocationExpectsResponse"));
}
return responseMessageContext;