本文整理汇总了Java中org.apache.axis2.description.AxisOperation类的典型用法代码示例。如果您正苦于以下问题:Java AxisOperation类的具体用法?Java AxisOperation怎么用?Java AxisOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AxisOperation类属于org.apache.axis2.description包,在下文中一共展示了AxisOperation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatchAndVerify
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
/**
* Finds axis Service and the Operation for DSS requests
*
* @param msgContext request message context
* @throws AxisFault if any exception occurs while finding axis service or operation
*/
private static void dispatchAndVerify(MessageContext msgContext) throws AxisFault {
requestDispatcher.invoke(msgContext);
AxisService axisService = msgContext.getAxisService();
if (axisService != null) {
httpLocationBasedDispatcher.invoke(msgContext);
if (msgContext.getAxisOperation() == null) {
requestURIOperationDispatcher.invoke(msgContext);
}
AxisOperation axisOperation;
if ((axisOperation = msgContext.getAxisOperation()) != null) {
AxisEndpoint axisEndpoint =
(AxisEndpoint) msgContext.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
if (axisEndpoint != null) {
AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisEndpoint
.getBinding().getChild(axisOperation.getName());
msgContext.setProperty(Constants.AXIS_BINDING_OPERATION, axisBindingOperation);
}
msgContext.setAxisOperation(axisOperation);
}
}
}
示例2: getAbstractResponseMessageContext
import org.apache.axis2.description.AxisOperation; //导入依赖的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;
}
示例3: getOperationClient
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
private static OperationClient getOperationClient(MessageContext partnerMessageContext,
ConfigurationContext clientConfigCtx)
throws AxisFault {
AxisService anonymousService =
AnonymousServiceFactory.getAnonymousService(Constants.registrationService,
Constants.REGISTRATION_PORT,
clientConfigCtx.getAxisConfiguration(), Constants.HUMANTASK_COORDINATION_MODULE_NAME);
anonymousService.getParent().addParameter("hiddenService", "true");
ServiceGroupContext sgc = new ServiceGroupContext(clientConfigCtx, (AxisServiceGroup) anonymousService.getParent());
ServiceContext serviceCtx = sgc.getServiceContext(anonymousService);
AxisOperation axisAnonymousOperation = anonymousService.getOperation(ServiceClient.ANON_OUT_IN_OP);
Options clientOptions = cloneOptions(partnerMessageContext.getOptions());
clientOptions.setExceptionToBeThrownOnSOAPFault(false);
/* This value doesn't overrideend point config. */
clientOptions.setTimeOutInMilliSeconds(60000);
return axisAnonymousOperation.createClient(serviceCtx, clientOptions);
}
示例4: testGlobalDisengagement
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
public void testGlobalDisengagement() throws AxisFault {
AxisModule module = config.getModule("testModule");
assertNotNull(module);
Phase phase;
Phase userPhase;
List globalinflow = config.getInFlowPhases();
assertNotNull(globalinflow);
phase = (Phase) globalinflow.get(3);
assertNotNull(phase);
assertEquals(phase.getHandlerCount(), 0);
AxisService service = config.getService(serviceName);
assertNotNull(service);
AxisOperation operation = service.getOperation(opName);
assertNotNull(operation);
userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
assertNotNull(userPhase);
assertEquals(0, userPhase.getHandlerCount());
config.engageModule(module.getName());
assertEquals(2, phase.getHandlerCount());
assertEquals(1, userPhase.getHandlerCount());
config.disengageModule(module);
assertEquals(0, phase.getHandlerCount());
assertEquals(0, userPhase.getHandlerCount());
}
示例5: getOperationClient
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
private static OperationClient getOperationClient(ServiceInvocationContext partnerMessageContext,
ConfigurationContext clientConfigCtx)
throws AxisFault {
AxisService anonymousService =
AnonymousServiceFactory.getAnonymousService(partnerMessageContext.getService(),
partnerMessageContext.getPort(),
clientConfigCtx.getAxisConfiguration(), partnerMessageContext.getCaller());
anonymousService.engageModule(clientConfigCtx.getAxisConfiguration().getModule("UEPModule"));
anonymousService.getParent().addParameter(
"hiddenService", "true");
ServiceGroupContext sgc = new ServiceGroupContext(
clientConfigCtx, (AxisServiceGroup) anonymousService.getParent());
ServiceContext serviceCtx = sgc.getServiceContext(anonymousService);
// get a reference to the DYNAMIC operation of the Anonymous Axis2 service
AxisOperation axisAnonymousOperation = anonymousService.getOperation(
partnerMessageContext.isTwoWay() ? ServiceClient.ANON_OUT_IN_OP :
ServiceClient.ANON_OUT_ONLY_OP);
Options clientOptions = cloneOptions(partnerMessageContext.getInMessageContext().getOptions());
clientOptions.setExceptionToBeThrownOnSOAPFault(false);
/* This value doesn't overrideend point config. */
clientOptions.setTimeOutInMilliSeconds(60000);
return axisAnonymousOperation.createClient(serviceCtx, clientOptions);
}
示例6: getUpperLevel
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
private AxisDescription getUpperLevel(short type, AxisDescription thisLevel) {
switch (type) {
case AXIS_BINDING_MESSAGE:
return ((AxisBindingMessage) thisLevel).getAxisBindingOperation();
case AXIS_BINDING_OPERATION:
return ((AxisBindingOperation) thisLevel).getAxisBinding();
case AXIS_BINDING:
return ((AxisBinding) thisLevel).getAxisEndpoint();
case AXIS_ENDPOINT:
return ((AxisEndpoint) thisLevel).getAxisService();
case AXIS_MESSAGE:
return ((AxisMessage) thisLevel).getAxisOperation();
case AXIS_OPERATION:
return ((AxisOperation) thisLevel).getAxisService();
case AXIS_SERVICE:
return ((AxisService) thisLevel).getAxisServiceGroup();
case AXIS_SERVICE_GROUP:
return ((AxisServiceGroup) thisLevel).getAxisConfiguration();
default:
return null;
}
}
示例7: findOperation
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
private Method findOperation(AxisOperation op, Class implClass) {
Method method = (Method)(op.getParameterValue("myMethod"));
if (method != null && method.getDeclaringClass() == implClass) return method;
String methodName = op.getName().getLocalPart();
try {
// Looking for a method of the form "void method(OMElement)"
method = implClass.getMethod(methodName, new Class [] { OMElement.class });
if (method.getReturnType().equals(void.class)) {
try {
op.addParameter("myMethod", method);
} catch (AxisFault axisFault) {
// Do nothing here
}
return method;
}
} catch (NoSuchMethodException e) {
// Fall through
}
return null;
}
示例8: createMessageContext
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
public MessageContext createMessageContext() throws AxisFault {
MessageContext msgContext = listener.createMessageContext();
if (service != null) {
msgContext.setAxisService(service);
// find the operation for the message, or default to one
Parameter operationParam = service.getParameter(BaseConstants.OPERATION_PARAM);
QName operationQName = (
operationParam != null ?
BaseUtils.getQNameFromString(operationParam.getValue()) :
BaseConstants.DEFAULT_OPERATION);
AxisOperation operation = service.getOperation(operationQName);
if (operation != null) {
msgContext.setAxisOperation(operation);
msgContext.setAxisMessage(
operation.getMessage(WSDL2Constants.MESSAGE_LABEL_IN));
msgContext.setSoapAction("urn:" + operation.getName().getLocalPart());
}
}
return msgContext;
}
示例9: prepareOperationList
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
/**
* Prepares a list of service names deployed in current runtime
* @param msgCtx
* @return
*/
private static String prepareOperationList(MessageContext msgCtx,String chatMessage) {
StringBuffer sb = new StringBuffer();
//extract service name
String serviceName = chatMessage.replace("getOperations", "");
serviceName = serviceName.replaceAll(" ", "");
if(log.isDebugEnabled()){
log.debug("Finding operations for service :"+ serviceName);
}
try {
AxisService service = msgCtx.getConfigurationContext().getAxisConfiguration().getService(serviceName);
Iterator itrOperations = service.getOperations();
int index = 1;
while(itrOperations.hasNext()){
AxisOperation operation = (AxisOperation)itrOperations.next();
String parameterList = getParameterListForOperation(operation);
sb.append(index +"."+operation.getName().getLocalPart()+"("+parameterList+")"+"\n");
index++;
}
} catch (AxisFault e) {
log.error("Error occurred while retreiving AxisService : "+serviceName,e);
sb.append("Error occurred while retrieving operations for service : "+serviceName);
}
return sb.toString();
}
示例10: setUp
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
public void setUp() throws Exception{
super.setUp();
AxisService as = deployClassAsService(Echo.SERVICE_NAME, Echo.class);
AxisOperation operation = as.getOperation(new QName(Echo.ECHO_OM_ELEMENT_OP_NAME));
ArrayList phasec = new ArrayList();
phasec.add(new Phase(PhaseMetadata.PHASE_POLICY_DETERMINATION));
operation.setRemainingPhasesInFlow(phasec);
ArrayList phase = operation.getRemainingPhasesInFlow();
for (int i = 0; i < phase.size(); i++) {
Phase phase1 = (Phase)phase.get(i);
if (PhaseMetadata.PHASE_POLICY_DETERMINATION.equals(phase1.getPhaseName())) {
phase1.addHandler(culprit);
}
}
}
示例11: createRedirectReceiverService
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
AxisService createRedirectReceiverService() throws AxisFault {
AxisService service = new AxisService("RedirectReceiverService");
service.setClassLoader(Thread.currentThread().getContextClassLoader());
service.addParameter(
new Parameter(Constants.SERVICE_CLASS, RedirectReceiver.class.getName()));
AxisOperation axisOp = new InOnlyAxisOperation(new QName("echoOMElementResponse"));
axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver());
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);
service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + "echoOMElementResponse",
axisOp);
AxisOperation axisOp2 = new InOnlyAxisOperation(new QName("fault"));
axisOp2.setMessageReceiver(new RawXMLINOnlyMessageReceiver());
axisOp2.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp2);
service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + "fault", axisOp2);
return service;
}
示例12: createSimpleOneWayServiceforClient
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
public static AxisService createSimpleOneWayServiceforClient(QName serviceName,
String className,
QName opName)
throws AxisFault {
AxisService service = new AxisService(serviceName.getLocalPart());
service.setClassLoader(Thread.currentThread().getContextClassLoader());
service.addParameter(new Parameter(Constants.SERVICE_CLASS, className));
AxisOperation axisOp = new OutOnlyAxisOperation(opName);
axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver());
axisOp.setStyle(WSDLConstants.STYLE_RPC);
service.addOperation(axisOp);
return service;
}
示例13: testWriteToXMLtoJSON
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
@Test
public void testWriteToXMLtoJSON() throws Exception {
jsonString = "{\"response\":{\"return\":{\"name\":\"kate\",\"age\":\"35\",\"gender\":\"female\"}}}";
String fileName = "test-resources/custom_schema/testSchema_1.xsd";
InputStream is = new FileInputStream(fileName);
XmlSchemaCollection schemaCol = new XmlSchemaCollection();
XmlSchema schema = schemaCol.read(new StreamSource(is), null);
QName elementQName = new QName("http://www.w3schools.com", "response");
ConfigurationContext configCtxt = new ConfigurationContext(new AxisConfiguration());
outMsgContext.setConfigurationContext(configCtxt);
AxisOperation axisOperation = AxisOperationFactory.getAxisOperation(AxisOperation.MEP_CONSTANT_IN_OUT);
AxisMessage message = new AxisMessage();
message.setElementQName(elementQName);
axisOperation.addMessage(message , WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
outMsgContext.setAxisOperation(axisOperation);
AxisService axisService = new AxisService("testService");
axisService.addSchema(schema);
outMsgContext.setAxisService(axisService);
soapEnvelope.getBody().addChild(getResponseOMElement());
outMsgContext.setEnvelope(soapEnvelope);
JsonFormatter jsonFormatter = new JsonFormatter();
jsonFormatter.writeTo(outMsgContext, outputFormat , outputStream , false);
String response = outputStream.toString();
Assert.assertEquals(jsonString, response);
}
示例14: 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);
}
}
}
}
示例15: OperationDescriptionImpl
import org.apache.axis2.description.AxisOperation; //导入依赖的package包/类
OperationDescriptionImpl(AxisOperation operation, EndpointInterfaceDescription parent) {
parentEndpointInterfaceDescription = parent;
partAttachmentMap = new HashMap<String, AttachmentDescription>();
axisOperation = operation;
if(this.axisOperation != null) {
this.operationQName = axisOperation.getName();
try {
this.axisOperation.addParameter(new Parameter(OperationDescription.AXIS_OPERATION_PARAMETER,
this));
}
catch(AxisFault af) {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("operationDescriptionErr1"));
}
}
buildAttachmentInformation();
}