本文整理汇总了Java中org.apache.axis2.description.AxisOperation.getMessageExchangePattern方法的典型用法代码示例。如果您正苦于以下问题:Java AxisOperation.getMessageExchangePattern方法的具体用法?Java AxisOperation.getMessageExchangePattern怎么用?Java AxisOperation.getMessageExchangePattern使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.description.AxisOperation
的用法示例。
在下文中一共展示了AxisOperation.getMessageExchangePattern方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkMessageIDHeader
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
* Validate that a message id is present when required. The check applied here only applies to
* WS-Addressing headers that comply with the 2005/08 (final) spec.
*
* @param msgContext
* @throws AxisFault
* @see AddressingInHandler#checkForMandatoryHeaders
*/
private void checkMessageIDHeader(MessageContext msgContext) throws AxisFault {
String namespace = (String)msgContext.getLocalProperty(WS_ADDRESSING_VERSION);
if (!Final.WSA_NAMESPACE.equals(namespace)) {
return;
}
AxisOperation axisOperation = msgContext.getAxisOperation();
if (axisOperation != null) {
String mep = axisOperation.getMessageExchangePattern();
int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY) {
String messageId = msgContext.getOptions().getMessageId();
if (messageId == null || "".equals(messageId)) {
AddressingFaultsHelper
.triggerMessageAddressingRequiredFault(msgContext, WSA_MESSAGE_ID);
}
}
}
}
示例2: migrateContextToThread
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public void migrateContextToThread(MessageContext messageContext)
throws AxisFault {
//Only make the context map available if we have an inbound request
//message, in the server.
AxisOperation axisOperation = messageContext.getAxisOperation();
String mep = axisOperation.getMessageExchangePattern();
int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY)
{
EndpointContextMap map = (EndpointContextMap)
messageContext.getConfigurationContext().getProperty(Constants.ENDPOINT_CONTEXT_MAP);
EndpointContextMapManager.setEndpointContextMap(map);
}
}
示例3: isOneWay
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public static boolean isOneWay(org.apache.axis2.context.MessageContext mc) {
if (mc != null) {
AxisOperation op = mc.getAxisOperation();
String mep = op.getMessageExchangePattern();
if (mep.equals(WSDL20_2004_Constants.MEP_URI_ROBUST_IN_ONLY) ||
mep.equals(WSDL20_2004_Constants.MEP_URI_IN_ONLY) ||
mep.equals(WSDL20_2006Constants.MEP_URI_ROBUST_IN_ONLY) ||
mep.equals(WSDL20_2006Constants.MEP_URI_IN_ONLY)||
mep.equals(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY)||
mep.equals(WSDL2Constants.MEP_URI_IN_ONLY)) {
return true;
}
}
return false;
}
示例4: cleanupThread
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public void cleanupThread(MessageContext messageContext) {
//Only clean up if we are inbound to the server.
AxisOperation axisOperation = messageContext.getAxisOperation();
String mep = axisOperation.getMessageExchangePattern();
int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
mepConstant == WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY)
{
EndpointContextMapManager.setEndpointContextMap(null);
}
}
示例5: addHeaderOperations
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
* populate the header parameters
*
* @param soapHeaderParameterQNameList
* @param bindingOperation
* @param input
*/
protected void addHeaderOperations(List soapHeaderParameterQNameList,
AxisBindingOperation bindingOperation,
boolean input) {
AxisOperation axisOperation = bindingOperation.getAxisOperation();
ArrayList headerparamList = new ArrayList();
String MEP = axisOperation.getMessageExchangePattern();
if (input) {
if (WSDLUtil.isInputPresentForMEP(MEP)) {
headerparamList = (ArrayList) getBindingPropertyFromMessage(
WSDL2Constants.ATTR_WSOAP_HEADER, bindingOperation.getName(),
WSDLConstants.MESSAGE_LABEL_IN_VALUE);
}
} else {
if (WSDLUtil.isOutputPresentForMEP(MEP)) {
headerparamList = (ArrayList) getBindingPropertyFromMessage(
WSDL2Constants.ATTR_WSOAP_HEADER, bindingOperation.getName(),
WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
}
}
if (headerparamList != null) {
for (Iterator iterator = headerparamList.iterator(); iterator.hasNext();) {
SOAPHeaderMessage header = (SOAPHeaderMessage) iterator.next();
soapHeaderParameterQNameList.add(header);
}
}
}
示例6: getInputElement
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
* Get the input element
*
* @param doc
* @param bindingOperation
* @param headerParameterQNameList
* @return DOM element
*/
protected Element getInputElement(Document doc,
AxisBindingOperation bindingOperation,
List headerParameterQNameList) {
AxisOperation operation = bindingOperation.getAxisOperation();
Element inputElt = doc.createElement("input");
String mep = operation.getMessageExchangePattern();
if (WSDLUtil.isInputPresentForMEP(mep)) {
Element[] param = getInputParamElement(doc, operation);
for (int i = 0; i < param.length; i++) {
inputElt.appendChild(param[i]);
}
List parameterElementList = getParameterElementList(doc, headerParameterQNameList,
WSDLConstants.SOAP_HEADER);
parameterElementList.addAll(getParameterElementListForHttpHeader(doc,
(ArrayList) getBindingPropertyFromMessage(
WSDL2Constants.ATTR_WHTTP_HEADER,
operation.getName(),
WSDLConstants.WSDL_MESSAGE_DIRECTION_IN),
WSDLConstants.HTTP_HEADER));
parameterElementList.addAll(getParameterElementListForSOAPModules(doc,
(ArrayList) getBindingPropertyFromMessage(
WSDL2Constants.ATTR_WSOAP_MODULE,
operation.getName(),
WSDLConstants.WSDL_MESSAGE_DIRECTION_IN)));
for (int i = 0; i < parameterElementList.size(); i++) {
inputElt.appendChild((Element) parameterElementList.get(i));
}
/*
* Setting the effective policy of input message
*/
Policy policy = getBindingPolicyFromMessage(bindingOperation,
WSDLConstants.MESSAGE_LABEL_IN_VALUE);
if (policy != null) {
try {
addAttribute(doc, "policy",
PolicyUtil.getSafeString(PolicyUtil.policyComponentToString(policy)),
inputElt);
} catch (Exception ex) {
throw new RuntimeException("can't serialize the policy ..", ex);
}
}
}
return inputElt;
}
示例7: getOutputElement
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
* Finds the output element.
*
* @param doc
* @param bindingOperation
* @param headerParameterQNameList
*/
protected Element getOutputElement(Document doc,
AxisBindingOperation bindingOperation,
List headerParameterQNameList) {
AxisOperation operation = bindingOperation.getAxisOperation();
Element outputElt = doc.createElement("output");
String mep = operation.getMessageExchangePattern();
if (WSDLUtil.isOutputPresentForMEP(mep)) {
Element param = getOutputParamElement(doc, operation);
if (param != null) {
outputElt.appendChild(param);
}
List outputElementList = getParameterElementList(doc, headerParameterQNameList,
WSDLConstants.SOAP_HEADER);
outputElementList.addAll(getParameterElementListForHttpHeader(doc,
(ArrayList) getBindingPropertyFromMessage(
WSDL2Constants.ATTR_WHTTP_HEADER,
operation.getName(),
WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT),
WSDLConstants.HTTP_HEADER));
for (int i = 0; i < outputElementList.size(); i++) {
outputElt.appendChild((Element) outputElementList.get(i));
}
/*
* Setting the effective policy for the output message.
*/
Policy policy = getBindingPolicyFromMessage(bindingOperation,
WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
if (policy != null) {
try {
addAttribute(doc, "policy",
PolicyUtil.getSafeString(PolicyUtil.policyComponentToString(policy)),
outputElt);
} catch (Exception ex) {
throw new RuntimeException("can't serialize the policy ..", ex);
}
}
}
return outputElt;
}
示例8: getOutputElement
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
* Finds the output element.
*
* @param doc
* @param bindingOperation
* @param headerParameterQNameList
*/
protected Element getOutputElement(Document doc,
AxisBindingOperation bindingOperation,
List headerParameterQNameList) {
AxisOperation operation = bindingOperation.getAxisOperation();
Element outputElt = doc.createElement("output");
String mep = operation.getMessageExchangePattern();
if (WSDLUtil.isOutputPresentForMEP(mep)) {
Element param = getOutputParamElement(doc, operation);
if (param != null) {
outputElt.appendChild(param);
}
List outputElementList = getParameterElementList(doc, headerParameterQNameList,
WSDLConstants.SOAP_HEADER);
outputElementList.addAll(getParameterElementListForHttpHeader(doc,
(ArrayList) getBindingPropertyFromMessage(
WSDL2Constants.ATTR_WHTTP_HEADER,
operation.getName(),
WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT),
WSDLConstants.HTTP_HEADER));
for (int i = 0; i < outputElementList.size(); i++) {
outputElt.appendChild((Element) outputElementList.get(i));
}
/*
* Setting the effective policy for the output message.
*/
Policy policy = getBindingPolicyFromMessage(bindingOperation,
WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT);
if (policy != null) {
try {
addAttribute(doc, "policy",
PolicyUtil.getSafeString(PolicyUtil.policyComponentToString(policy)),
outputElt);
} catch (Exception ex) {
throw new RuntimeException("can't serialize the policy ..");
}
}
}
return outputElt;
}
示例9: getInputElement
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
* Get the input element
*
* @param doc
* @param bindingOperation
* @param headerParameterQNameList
* @return DOM element
*/
protected Element getInputElement(Document doc,
AxisBindingOperation bindingOperation,
List headerParameterQNameList) {
AxisOperation operation = bindingOperation.getAxisOperation();
Element inputElt = doc.createElement("input");
String mep = operation.getMessageExchangePattern();
if (WSDLUtil.isInputPresentForMEP(mep)) {
Element[] param = getInputParamElement(doc, operation);
for (int i = 0; i < param.length; i++) {
inputElt.appendChild(param[i]);
}
List parameterElementList = getParameterElementList(doc, headerParameterQNameList,
WSDLConstants.SOAP_HEADER);
parameterElementList.addAll(getParameterElementListForHttpHeader(doc,
(ArrayList) getBindingPropertyFromMessage(
WSDL2Constants.ATTR_WHTTP_HEADER,
operation.getName(),
WSDLConstants.WSDL_MESSAGE_DIRECTION_IN),
WSDLConstants.HTTP_HEADER));
parameterElementList.addAll(getParameterElementListForSOAPModules(doc,
(ArrayList) getBindingPropertyFromMessage(
WSDL2Constants.ATTR_WSOAP_MODULE,
operation.getName(),
WSDLConstants.WSDL_MESSAGE_DIRECTION_IN)));
for (int i = 0; i < parameterElementList.size(); i++) {
inputElt.appendChild((Element) parameterElementList.get(i));
}
/*
* Setting the effective policy of input message
*/
Policy policy = getBindingPolicyFromMessage(bindingOperation,
WSDLConstants.WSDL_MESSAGE_DIRECTION_IN);
if (policy != null) {
try {
addAttribute(doc, "policy",
PolicyUtil.getSafeString(PolicyUtil.policyComponentToString(policy)),
inputElt);
} catch (Exception ex) {
throw new RuntimeException("can't serialize the policy ..");
}
}
}
return inputElt;
}
示例10: flowComplete
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
@Override
// Handle IN_ONLY operations
public void flowComplete(MessageContext msgContext) {
if (msgContext.getEnvelope() == null) {
return;
}
AxisService axisService = msgContext.getAxisService();
if (axisService == null ||
SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup()) ||
axisService.isClientSide()) {
return;
}
try {
// Process Request Counter
OperationContext opContext = msgContext.getOperationContext();
if (opContext != null && opContext.isComplete()) {
AxisOperation axisOp = opContext.getAxisOperation();
if (axisOp != null && axisOp.isControlOperation()) {
return;
}
if (axisOp != null) {
String mep = axisOp.getMessageExchangePattern();
if (mep != null &&
(mep.equals(WSDL2Constants.MEP_URI_IN_ONLY) ||
mep.equals(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY))) {
// Increment operation counter
final AxisOperation axisOperation = msgContext.getAxisOperation();
if (axisOperation != null) {
Parameter operationParameter =
axisOperation.getParameter(StatisticsConstants.IN_OPERATION_COUNTER);
if (operationParameter != null) {
((AtomicInteger) operationParameter.getValue()).incrementAndGet();
} else {
log.error(StatisticsConstants.IN_OPERATION_COUNTER +
" has not been set for operation " +
axisService.getName() + "." + axisOperation.getName());
return;
}
// Calculate response times
try {
ResponseTimeCalculator.calculateResponseTimes(msgContext);
} catch (AxisFault axisFault) {
log.error("Cannot compute response times", axisFault);
}
}
// Increment global counter
Parameter globalRequestCounter =
msgContext.getParameter(StatisticsConstants.GLOBAL_REQUEST_COUNTER);
((AtomicInteger) globalRequestCounter.getValue()).incrementAndGet();
updateCurrentInvocationGlobalStatistics(msgContext);
}
}
}
} catch (Throwable e) { // Catching Throwable since exceptions here should not be propagated up
log.error("Could not call InOnlyMEPHandler.flowComplete", e);
}
}
示例11: invoke
import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public InvocationResponse invoke(MessageContext outMsgContext) throws AxisFault {
if(outMsgContext.getEnvelope() == null){
return InvocationResponse.CONTINUE;
}
if (outMsgContext.getFLOW() != MessageContext.OUT_FLOW &&
outMsgContext.getFLOW() != MessageContext.OUT_FAULT_FLOW) {
log.error("InOutMEPHandler not deployed in OUT/OUT_FAULT flow. Flow: " +
outMsgContext.getFLOW());
return InvocationResponse.CONTINUE;
}
try {
AxisService axisService = outMsgContext.getAxisService();
if(axisService == null) {
updateStatistics(outMsgContext);
return InvocationResponse.CONTINUE;
} else if (SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup()) ||
axisService.isClientSide()) {
return InvocationResponse.CONTINUE;
}
final AxisOperation axisOperation = outMsgContext.getAxisOperation();
if(axisOperation != null && axisOperation.isControlOperation()){
return InvocationResponse.CONTINUE;
}
if (axisOperation != null) {
String mep = axisOperation.getMessageExchangePattern();
if (mep != null &&
(mep.equals(WSDL2Constants.MEP_URI_OUT_IN) ||
mep.equals(WSDL2Constants.MEP_URI_OUT_ONLY) ||
mep.equals(WSDL2Constants.MEP_URI_OUT_OPTIONAL_IN))) { // If this ConfigurationContext is used for sending messages out, do not change the stats
return InvocationResponse.CONTINUE;
}
// Process operation request count
Parameter inOpCounter =
axisOperation.getParameter(StatisticsConstants.IN_OPERATION_COUNTER);
if (inOpCounter != null) {
((AtomicInteger) inOpCounter.getValue()).incrementAndGet();
} else {
log.error(StatisticsConstants.IN_OPERATION_COUNTER +
" has not been set for operation " +
axisService.getName() + "." + axisOperation.getName());
return InvocationResponse.CONTINUE;
}
// Process operation response count
Parameter outOpCounter =
axisOperation.getParameter(StatisticsConstants.OUT_OPERATION_COUNTER);
if (outOpCounter != null) {
((AtomicInteger) outOpCounter.getValue()).incrementAndGet();
} else {
log.error(StatisticsConstants.OUT_OPERATION_COUNTER +
" has not been set for operation " +
axisService.getName() + "." + axisOperation.getName());
return InvocationResponse.CONTINUE;
}
}
updateStatistics(outMsgContext);
} catch (Throwable e) {
log.error("Could not call InOutMEPHandler.invoke", e);
}
return InvocationResponse.CONTINUE;
}