1 package org.apache.axis2.engine.util; 2 3 import org.apache.axis2.clientapi.Call; 4 import org.apache.axis2.context.MessageContext; 5 import org.apache.axis2.description.OperationDescription; 6 import org.apache.axis2.engine.AxisFault; 7 import org.apache.axis2.om.OMElement; 8 import org.apache.axis2.soap.SOAPEnvelope; 9 10 import javax.xml.namespace.QName ; 11 12 29 30 public class MyInOutMEPClient extends Call{ 31 32 public MyInOutMEPClient() throws AxisFault { 33 super(assumeServiceContext(null)); 34 } 35 36 public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop, OMElement toSend) throws AxisFault { 37 OperationDescription axisConfig = 38 serviceContext.getServiceConfig().getOperation(new QName (axisop)); 39 if (axisConfig == null) { 40 axisConfig = new OperationDescription(new QName (axisop)); 41 axisConfig.setRemainingPhasesInFlow(operationTemplate.getRemainingPhasesInFlow()); 42 axisConfig.setPhasesOutFlow(operationTemplate.getPhasesOutFlow()); 43 axisConfig.setPhasesInFaultFlow(operationTemplate.getPhasesInFaultFlow()); 44 axisConfig.setPhasesOutFaultFlow(operationTemplate.getPhasesOutFaultFlow()); 45 serviceContext.getServiceConfig().addOperation(axisConfig); 46 } 47 48 MessageContext msgctx = prepareTheSystem(toSend); 53 54 MessageContext responseContext = super.invokeBlocking(axisConfig, msgctx); 55 SOAPEnvelope envelope = responseContext.getEnvelope(); 56 return envelope; 57 } 58 } 59 | Popular Tags |