热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.axis2.description.AxisOperation.setMessageReceiver()方法的使用及代码示例

本文整理了Java中org.apache.axis2.description.AxisOperation.setMessageReceiver()方法的一些代码示例,展

本文整理了Java中org.apache.axis2.description.AxisOperation.setMessageReceiver()方法的一些代码示例,展示了AxisOperation.setMessageReceiver()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AxisOperation.setMessageReceiver()方法的具体详情如下:
包路径:org.apache.axis2.description.AxisOperation
类名称:AxisOperation
方法名:setMessageReceiver

AxisOperation.setMessageReceiver介绍

暂无

代码示例

代码示例来源:origin: org.apache.axis2/axis2-transport-testkit

@Override
protected AxisOperation createOperation() {
AxisOperation operation = new InOnlyAxisOperation(new QName("in"));
operation.setMessageReceiver(messageReceiver);
return operation;
}

代码示例来源:origin: org.apache.axis2.transport/axis2-transport-testkit

@Override
protected AxisOperation createOperation() {
AxisOperation operation = new InOnlyAxisOperation(new QName("in"));
operation.setMessageReceiver(messageReceiver);
return operation;
}

代码示例来源:origin: apache/axis2-java

@Override
protected AxisOperation createOperation() {
AxisOperation operation = new InOnlyAxisOperation(new QName("in"));
operation.setMessageReceiver(messageReceiver);
return operation;
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

public void setMessageReceivers(AxisService service) {
Iterator iterator = service.getOperations();
while (iterator.hasNext()) {
AxisOperation operation = iterator.next();
String MEP = operation.getMessageExchangePattern();
if (MEP != null) {
try {
if (WSDL2Constants.MEP_URI_IN_ONLY.equals(MEP)) {
Class inOnlyMessageReceiver= Loader.loadClass(
"org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver");
MessageReceiver messageReceiver =
(MessageReceiver) inOnlyMessageReceiver.newInstance();
operation.setMessageReceiver(messageReceiver);
} else {
Class inoutMessageReceiver = Loader.loadClass(
"org.apache.axis2.rpc.receivers.RPCMessageReceiver");
MessageReceiver inOutmessageReceiver =
(MessageReceiver) inoutMessageReceiver.newInstance();
operation.setMessageReceiver(inOutmessageReceiver);
}
} catch (ClassNotFoundException e) {
log.error(e.getMessage(), e);
} catch (InstantiationException e) {
log.error(e.getMessage(), e);
} catch (IllegalAccessException e) {
log.error(e.getMessage(), e);
}
}
}
}

代码示例来源:origin: apache/axis2-java

public void setMessageReceivers(AxisService service) {
Iterator iterator = service.getOperations();
while (iterator.hasNext()) {
AxisOperation operation = iterator.next();
String MEP = operation.getMessageExchangePattern();
if (MEP != null) {
try {
if (WSDL2Constants.MEP_URI_IN_ONLY.equals(MEP)) {
Class inOnlyMessageReceiver= Loader.loadClass(
"org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver");
MessageReceiver messageReceiver =
(MessageReceiver) inOnlyMessageReceiver.newInstance();
operation.setMessageReceiver(messageReceiver);
} else {
Class inoutMessageReceiver = Loader.loadClass(
"org.apache.axis2.rpc.receivers.RPCMessageReceiver");
MessageReceiver inOutmessageReceiver =
(MessageReceiver) inoutMessageReceiver.newInstance();
operation.setMessageReceiver(inOutmessageReceiver);
}
} catch (ClassNotFoundException e) {
log.error(e.getMessage(), e);
} catch (InstantiationException e) {
log.error(e.getMessage(), e);
} catch (IllegalAccessException e) {
log.error(e.getMessage(), e);
}
}
}
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

private void setDefaultMessageReceivers() {
Iterator operatiOns= service.getPublishedOperations().iterator();
while (operations.hasNext()) {
AxisOperation operation = (AxisOperation) operations.next();
if (operation.getMessageReceiver() == null) {
MessageReceiver messageReceiver = loadDefaultMessageReceiver(
operation.getMessageExchangePattern(), service);
if (messageReceiver == null &&
// we assume that if the MEP is ROBUST_IN_ONLY then the in-out
// MR can handle that
WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(operation
.getMessageExchangePattern())) {
messageReceiver = loadDefaultMessageReceiver(
WSDL2Constants.MEP_URI_IN_OUT, service);
}
operation.setMessageReceiver(messageReceiver);
}
}
}

代码示例来源:origin: apache/axis2-java

private void setDefaultMessageReceivers() {
Iterator operatiOns= service.getPublishedOperations().iterator();
while (operations.hasNext()) {
AxisOperation operation = (AxisOperation) operations.next();
if (operation.getMessageReceiver() == null) {
MessageReceiver messageReceiver = loadDefaultMessageReceiver(
operation.getMessageExchangePattern(), service);
if (messageReceiver == null &&
// we assume that if the MEP is ROBUST_IN_ONLY then the in-out
// MR can handle that
WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(operation
.getMessageExchangePattern())) {
messageReceiver = loadDefaultMessageReceiver(
WSDL2Constants.MEP_URI_IN_OUT, service);
}
operation.setMessageReceiver(messageReceiver);
}
}
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-binding-ws-axis2

private void setMessageReceivers(Wire wire, AxisService axisService) throws Exception {
Map interceptors = new HashMap();
for (InvocationChain chain : wire.getInvocationChains()) {
interceptors.put(chain.getPhysicalOperation().getName(), chain);
}
Utils.fillAxisService(axisService, configurationContext.getAxisConfiguration(), null, null);
for (Iterator i = axisService.getOperations(); i.hasNext();) {
AxisOperation axisOp = (AxisOperation) i.next();
InvocationChain invocatiOnChain= interceptors.get(axisOp.getName().getLocalPart());
MessageReceiver messageReceiver = null;
if (WSDL2Constants.MEP_URI_IN_ONLY.equals(axisOp.getMessageExchangePattern()) ||
WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(axisOp.getMessageExchangePattern())) {
messageReceiver = new InOnlyServiceProxyHandler(invocationChain);
} else {//Default MEP is IN-OUT for backward compatibility
messageReceiver = new InOutServiceProxyHandler(invocationChain);
}
axisOp.setMessageReceiver(messageReceiver);
}
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

public static AxisService createSimpleInOnlyService(QName serviceName,
MessageReceiver messageReceiver,
QName opName)
throws AxisFault {
AxisService service = new AxisService(serviceName.getLocalPart());
service.setClassLoader(getContextClassLoader_DoPriv());
AxisOperation axisOp = new InOnlyAxisOperation(opName);
axisOp.setMessageReceiver(messageReceiver);
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);
service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(),
axisOp);
return service;
}

代码示例来源:origin: apache/axis2-java

public static AxisService createSimpleInOnlyService(QName serviceName,
MessageReceiver messageReceiver,
QName opName)
throws AxisFault {
AxisService service = new AxisService(serviceName.getLocalPart());
service.setClassLoader(getContextClassLoader_DoPriv());
AxisOperation axisOp = new InOnlyAxisOperation(opName);
axisOp.setMessageReceiver(messageReceiver);
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);
service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(),
axisOp);
return service;
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

public static AxisService createSimpleService(QName serviceName,
MessageReceiver messageReceiver, String className,
QName opName)
throws AxisFault {
AxisService service = new AxisService(serviceName.getLocalPart());
service.setClassLoader(getContextClassLoader_DoPriv());
service.addParameter(new Parameter(Constants.SERVICE_CLASS, className));
AxisOperation axisOp = new InOutAxisOperation(opName);
axisOp.setMessageReceiver(messageReceiver);
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);
service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(),
axisOp);
return service;
}

代码示例来源:origin: org.apache.axis2.transport/axis2-transport-testkit

axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver());
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);
axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver());
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);

代码示例来源:origin: org.apache.axis2/axis2-transport-testkit

axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver());
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);
axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver());
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);

代码示例来源:origin: apache/axis2-java

public static AxisService createSimpleService(QName serviceName,
MessageReceiver messageReceiver, String className,
QName opName)
throws AxisFault {
AxisService service = new AxisService(serviceName.getLocalPart());
service.setClassLoader(getContextClassLoader_DoPriv());
service.addParameter(new Parameter(Constants.SERVICE_CLASS, className));
AxisOperation axisOp = new InOutAxisOperation(opName);
axisOp.setMessageReceiver(messageReceiver);
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);
service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(),
axisOp);
return service;
}

代码示例来源:origin: org.apache.synapse/synapse-core

/**
* Adds Synapse Service to Axis2 configuration which enables the main message mediation.
*
* @throws AxisFault if an error occurs during Axis2 service initialization
*/
private void deploySynapseService() throws AxisFault {
log.info("Deploying the Synapse service...");
// Dynamically initialize the Synapse Service and deploy it into Axis2
AxisConfiguration axisCfg = configurationContext.getAxisConfiguration();
AxisService synapseService = new AxisService(SynapseConstants.SYNAPSE_SERVICE_NAME);
AxisOperation mediateOperation = new InOutAxisOperation(
SynapseConstants.SYNAPSE_OPERATION_NAME);
mediateOperation.setMessageReceiver(new SynapseMessageReceiver());
synapseService.addOperation(mediateOperation);
List transports = new ArrayList();
transports.add(Constants.TRANSPORT_HTTP);
transports.add(Constants.TRANSPORT_HTTPS);
synapseService.setExposedTransports(transports);
AxisServiceGroup synapseServiceGroup = new AxisServiceGroup(axisCfg);
synapseServiceGroup.setServiceGroupName(SynapseConstants.SYNAPSE_SERVICE_NAME);
synapseServiceGroup.addParameter(SynapseConstants.HIDDEN_SERVICE_PARAM, "true");
synapseServiceGroup.addService(synapseService);
axisCfg.addServiceGroup(synapseServiceGroup);
}

代码示例来源:origin: org.apache.axis2/axis2-kernel

public static AxisService createSimpleServiceforClient(QName serviceName,
MessageReceiver messageReceiver,
String className,
QName opName)
throws AxisFault {
AxisService service = new AxisService(serviceName.getLocalPart());
service.setClassLoader(getContextClassLoader_DoPriv());
service.addParameter(new Parameter(Constants.SERVICE_CLASS, className));
AxisOperation axisOp = new OutInAxisOperation(opName);
axisOp.setMessageReceiver(messageReceiver);
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);
return service;
}

代码示例来源:origin: wso2/wso2-synapse

/**
* Adds Synapse Service to Axis2 configuration which enables the main message mediation.
*
* @throws AxisFault if an error occurs during Axis2 service initialization
*/
private void deploySynapseService() throws AxisFault {
log.info("Deploying the Synapse service...");
// Dynamically initialize the Synapse Service and deploy it into Axis2
AxisConfiguration axisCfg = configurationContext.getAxisConfiguration();
AxisService synapseService = new AxisService(SynapseConstants.SYNAPSE_SERVICE_NAME);
AxisOperation mediateOperation = new InOutAxisOperation(
SynapseConstants.SYNAPSE_OPERATION_NAME);
mediateOperation.setMessageReceiver(new SynapseMessageReceiver());
synapseService.addOperation(mediateOperation);
List transports = new ArrayList();
transports.add(Constants.TRANSPORT_HTTP);
transports.add(Constants.TRANSPORT_HTTPS);
synapseService.setExposedTransports(transports);
AxisServiceGroup synapseServiceGroup = new AxisServiceGroup(axisCfg);
synapseServiceGroup.setServiceGroupName(SynapseConstants.SYNAPSE_SERVICE_NAME);
synapseServiceGroup.addParameter(SynapseConstants.HIDDEN_SERVICE_PARAM, "true");
synapseServiceGroup.addService(synapseService);
axisCfg.addServiceGroup(synapseServiceGroup);
}

代码示例来源:origin: apache/axis2-java

public static AxisService createSimpleServiceforClient(QName serviceName,
MessageReceiver messageReceiver,
String className,
QName opName)
throws AxisFault {
AxisService service = new AxisService(serviceName.getLocalPart());
service.setClassLoader(getContextClassLoader_DoPriv());
service.addParameter(new Parameter(Constants.SERVICE_CLASS, className));
AxisOperation axisOp = new OutInAxisOperation(opName);
axisOp.setMessageReceiver(messageReceiver);
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);
return service;
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-ws-runtime-axis2

public static void createAxisServiceProviders(AxisService axisService,
RuntimeEndpoint endpoint,
WebServiceBinding wsBinding,
ExtensionPointRegistry extensionPoints) {
for (Iterator i = axisService.getOperations(); i.hasNext();) {
AxisOperation axisOp = (AxisOperation)i.next();
Operation op = getOperation(axisOp, wsBinding);
if (op != null) {
if (op.isNonBlocking()) {
axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY);
} else {
axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT);
}
MessageReceiver msgrec = null;
TuscanyServiceProvider serviceProvider = new TuscanyServiceProvider(extensionPoints, endpoint, wsBinding, op);
if (op.isNonBlocking()) {
msgrec = new Axis2ServiceInMessageReceiver(serviceProvider);
} else {
msgrec = new Axis2ServiceInOutSyncMessageReceiver(serviceProvider);
}
axisOp.setMessageReceiver(msgrec);
}
}
}

代码示例来源:origin: wso2/wso2-synapse

private AxisOperation processOperationValidation(AxisService proxyService) throws AxisFault {
AxisOperation mediateOperation = new InOutAxisOperation(
SynapseConstants.SYNAPSE_OPERATION_NAME);
// Set the names of the two messages so that Axis2 is able to produce a WSDL (see SYNAPSE-366):
mediateOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE).setName("in");
mediateOperation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE).setName("out");
// create a custom message receiver for this proxy service
ProxyServiceMessageReceiver msgRcvr = new ProxyServiceMessageReceiver();
msgRcvr.setName(name);
msgRcvr.setProxy(this);
mediateOperation.setMessageReceiver(msgRcvr);
mediateOperation.setParent(proxyService);
proxyService.addParameter("_default_mediate_operation_", mediateOperation);
return mediateOperation;
}

推荐阅读
author-avatar
toto333
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有