本文整理汇总了Java中org.apache.axis2.context.MessageContext.setOptions方法的典型用法代码示例。如果您正苦于以下问题:Java MessageContext.setOptions方法的具体用法?Java MessageContext.setOptions怎么用?Java MessageContext.setOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.context.MessageContext
的用法示例。
在下文中一共展示了MessageContext.setOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: send
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
* Synchronously send the request and receive a response. This relies on the transport correctly connecting the
* response InputStream!
*
* @param msgContext the request MessageContext to send.
* @return Returns MessageContext.
* @throws AxisFault Sends the message using a two way transport and waits for a response
*/
protected MessageContext send(final MessageContext msgContext) throws AxisFault {
// create the responseMessageContext
final MessageContext responseMessageContext
= msgContext.getConfigurationContext().createMessageContext();
responseMessageContext.setServerSide(false);
responseMessageContext.setOperationContext(msgContext.getOperationContext());
responseMessageContext.setOptions(new Options(options));
responseMessageContext.setMessageID(msgContext.getMessageID());
addMessageContext(responseMessageContext);
responseMessageContext.setServiceContext(msgContext.getServiceContext());
responseMessageContext.setAxisMessage(
axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE));
//sending the message
AxisEngine.send(msgContext);
responseMessageContext.setDoingREST(msgContext.isDoingREST());
// Copy RESPONSE properties which the transport set onto the request message context when it processed
// the incoming response recieved in reply to an outgoing request.
responseMessageContext.setProperty(MessageContext.TRANSPORT_HEADERS,
msgContext.getProperty(MessageContext.TRANSPORT_HEADERS));
responseMessageContext.setProperty(HTTPConstants.MC_HTTP_STATUS_CODE,
msgContext.getProperty(HTTPConstants.MC_HTTP_STATUS_CODE));
responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgContext
.getProperty(MessageContext.TRANSPORT_IN));
responseMessageContext.setTransportIn(msgContext.getTransportIn());
responseMessageContext.setTransportOut(msgContext.getTransportOut());
handleResponse(responseMessageContext);
return responseMessageContext;
}
示例2: prepareMessageContext
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
* prepareMessageContext gets a fresh new MessageContext ready to be sent.
* It sets up the necessary properties, transport information, etc.
*
* @param configurationContext the active ConfigurationContext
* @param mc the MessageContext to be configured
* @throws AxisFault if there is a problem
*/
protected void prepareMessageContext(ConfigurationContext configurationContext,
MessageContext mc)
throws AxisFault {
// set options on the message context
if (mc.getSoapAction() == null || "".equals(mc.getSoapAction())) {
mc.setSoapAction(options.getAction());
}
mc.setOptions(new Options(options));
mc.setAxisMessage(axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE));
// do Target Resolution
TargetResolver targetResolver =
configurationContext.getAxisConfiguration().getTargetResolverChain();
if (targetResolver != null) {
targetResolver.resolveTarget(mc);
}
// if the transport to use for sending is not specified, try to find it
// from the URL
TransportOutDescription senderTransport = options.getTransportOut();
if (senderTransport == null) {
EndpointReference toEPR = (options.getTo() != null) ? options
.getTo() : mc.getTo();
senderTransport = ClientUtils.inferOutTransport(configurationContext
.getAxisConfiguration(), toEPR, mc);
}
mc.setTransportOut(senderTransport);
if (options.getParent() !=null && options.getParent().isManageSession()) {
mc.getOptions().setManageSession(true);
} else if (options.isManageSession()) {
mc.getOptions().setManageSession(true);
}
addReferenceParameters(mc);
}
示例3: send
import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
/**
* Synchronously send the request and receive a response. This relies on the transport
* correctly connecting the response InputStream!
*
* @param msgContext the request MessageContext to send.
* @return Returns MessageContext.
* @throws AxisFault Sends the message using a two way transport and waits for a response
*/
protected MessageContext send(MessageContext msgContext) throws AxisFault {
// create the responseMessageContext
MessageContext responseMessageContext =
msgContext.getConfigurationContext().createMessageContext();
responseMessageContext.setServerSide(false);
responseMessageContext.setOperationContext(msgContext.getOperationContext());
responseMessageContext.setOptions(new Options(options));
responseMessageContext.setMessageID(msgContext.getMessageID());
addMessageContext(responseMessageContext);
responseMessageContext.setServiceContext(msgContext.getServiceContext());
responseMessageContext.setAxisMessage(
axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE));
//sending the message
AxisEngine.send(msgContext);
responseMessageContext.setDoingREST(msgContext.isDoingREST());
// Copy RESPONSE properties which the transport set onto the request message context when it processed
// the incoming response recieved in reply to an outgoing request.
responseMessageContext.setProperty(MessageContext.TRANSPORT_HEADERS,
msgContext.getProperty(MessageContext.TRANSPORT_HEADERS));
responseMessageContext.setProperty(HTTPConstants.MC_HTTP_STATUS_CODE,
msgContext.getProperty(HTTPConstants.MC_HTTP_STATUS_CODE));
responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgContext
.getProperty(MessageContext.TRANSPORT_IN));
responseMessageContext.setTransportIn(msgContext.getTransportIn());
responseMessageContext.setTransportOut(msgContext.getTransportOut());
handleResponse(responseMessageContext);
return responseMessageContext;
}