本文整理汇总了Java中org.apache.axis2.util.MessageContextBuilder.createOutMessageContext方法的典型用法代码示例。如果您正苦于以下问题:Java MessageContextBuilder.createOutMessageContext方法的具体用法?Java MessageContextBuilder.createOutMessageContext怎么用?Java MessageContextBuilder.createOutMessageContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.util.MessageContextBuilder
的用法示例。
在下文中一共展示了MessageContextBuilder.createOutMessageContext方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createResponseMessageContext
import org.apache.axis2.util.MessageContextBuilder; //导入方法依赖的package包/类
/**
* Creates the {@link MessageContext} for the response to message currently being processed.
*
* @param reqContext The MessageContext of the received message
* @return The MessageContext for the response message
*/
public static MessageContext createResponseMessageContext(final MessageContext reqContext) {
try {
MessageContext resCtx = null;
// First try to get the context for the response from the OperationContext
final OperationContext opContext = reqContext.getOperationContext();
if (opContext != null) {
resCtx = opContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
}
// If that fails, construct a new context
if (resCtx == null) {
resCtx = MessageContextBuilder.createOutMessageContext(reqContext);
resCtx.getOperationContext().addMessageContext(resCtx);
}
return resCtx;
} catch (final AxisFault af) {
// Somewhere the construction of the new MessageContext failed
return null;
}
}
示例2: createResponseMessageContext
import org.apache.axis2.util.MessageContextBuilder; //导入方法依赖的package包/类
/**
* Given a request MessageContext, create a new MessageContext from there with the necessary
* information to make sure the new MessageContext is related to the existing one.
*
* @param mc - the MessageContext to use as the source
* @return
*/
public static MessageContext createResponseMessageContext(MessageContext mc) {
try {
org.apache.axis2.context.MessageContext sourceAxisMC = mc.getAxisMessageContext();
// There are a number of things that need to be copied over at the
// Axis2 level.
org.apache.axis2.context.MessageContext newAxisMC =
MessageContextBuilder.createOutMessageContext(sourceAxisMC);
MessageContext newMC = new MessageContext(newAxisMC);
newMC.setOutbound(true);
newMC.setServer(true);
newMC.setMEPContext(mc.getMEPContext());
newMC.setEndpointDescription(mc.getEndpointDescription());
newMC.setOperationDescription(mc.getOperationDescription());
return newMC;
} catch (AxisFault e) {
throw ExceptionFactory.makeWebServiceException(e);
}
}
示例3: getAbstractResponseMessageContext
import org.apache.axis2.util.MessageContextBuilder; //导入方法依赖的package包/类
public MessageContext getAbstractResponseMessageContext(MessageContext requestMessageContext) throws AxisFault {
MessageContext outMessageCtx = MessageContextBuilder.createOutMessageContext(requestMessageContext);
SOAPFactory factory = getSOAPFactory(requestMessageContext);
AxisOperation operation = requestMessageContext.getOperationContext().getAxisOperation();
AxisService service = requestMessageContext.getAxisService();
OMElement bodyContent;
AxisMessage outMessage = operation.getMessage(OperationsConstants.OUT);
bodyContent = factory.createOMElement(outMessage.getName(),
factory.createOMNamespace(namespace,
service.getSchemaTargetNamespacePrefix()));
try {
setPayload(bodyContent);
} catch (XMLStreamException e) {
String msg = "Error in adding the payload to the response message";
log.error(msg);
throw new AxisFault(msg, e);
}
SOAPEnvelope soapEnvelope = factory.getDefaultEnvelope();
soapEnvelope.getBody().addChild(bodyContent);
outMessageCtx.setEnvelope(soapEnvelope);
return outMessageCtx;
}
示例4: createResponseContext
import org.apache.axis2.util.MessageContextBuilder; //导入方法依赖的package包/类
/**
* Creates a new {@see MessageContext} for the response.
*
* @param msgContext The current, i.e. in flow, message context
* @return The new message context for the outgoing flow
* @throws AxisFault When an error occurs during the creation of the response
* message context
*/
protected MessageContext createResponseContext(final MessageContext msgContext) throws AxisFault {
final MessageContext outMsgContext = MessageContextBuilder.createOutMessageContext(msgContext);
outMsgContext.getOperationContext().addMessageContext(outMsgContext);
replicateState(msgContext);
return outMsgContext;
}
示例5: setOutMessageContextToBPELMessageContext
import org.apache.axis2.util.MessageContextBuilder; //导入方法依赖的package包/类
private static void setOutMessageContextToBPELMessageContext(
final BPELMessageContext bpelMessageContext)
throws AxisFault {
MessageContext outMessageContext = MessageContextBuilder
.createOutMessageContext(bpelMessageContext.getInMessageContext());
outMessageContext.getOperationContext().addMessageContext(outMessageContext);
bpelMessageContext.setOutMessageContext(outMessageContext);
}
示例6: dispatchResponse
import org.apache.axis2.util.MessageContextBuilder; //导入方法依赖的package包/类
/**
* Dispatch the message to the target endpoint
*
* @param soapEnvelope Soap Enevlop with message
* @param responseAction WSE action for the response
* @param mc Message Context
* @param isFault Whether a Fault message must be sent
* @throws AxisFault Thrown by the axis2 engine.
*/
private void dispatchResponse(SOAPEnvelope soapEnvelope, String responseAction,
MessageContext mc, boolean isFault) throws AxisFault {
MessageContext rmc = MessageContextBuilder.createOutMessageContext(mc);
rmc.getOperationContext().addMessageContext(rmc);
replicateState(mc);
rmc.setEnvelope(soapEnvelope);
rmc.setWSAAction(responseAction);
rmc.setSoapAction(responseAction);
if (isFault) {
AxisEngine.sendFault(rmc);
} else {
AxisEngine.send(rmc);
}
}
示例7: invokeBusinessLogic
import org.apache.axis2.util.MessageContextBuilder; //导入方法依赖的package包/类
public final void invokeBusinessLogic(MessageContext msgContext) throws AxisFault {
MessageContext outMsgContext = MessageContextBuilder.createOutMessageContext(msgContext);
outMsgContext.getOperationContext().addMessageContext(outMsgContext);
invokeBusinessLogic(msgContext, outMsgContext);
replicateState(msgContext);
AxisEngine.send(outMsgContext);
}