当前位置: 首页>>代码示例>>Java>>正文


Java MessageContext.setWSAAction方法代码示例

本文整理汇总了Java中org.apache.axis2.context.MessageContext.setWSAAction方法的典型用法代码示例。如果您正苦于以下问题:Java MessageContext.setWSAAction方法的具体用法?Java MessageContext.setWSAAction怎么用?Java MessageContext.setWSAAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.context.MessageContext的用法示例。


在下文中一共展示了MessageContext.setWSAAction方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate_action

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public void validate_action(MessageContext msgContext, MessageContext newmsgContext) {
	String in_action = msgContext.getWSAAction();
	
	String out_action = SoapActionFactory.getResponseAction(in_action);
	if (out_action == null) {
		newmsgContext.setFailureReason(new Exception("Unknown action <" + in_action + ">"));
		return;
	}
	newmsgContext.setWSAAction(out_action);
}
 
开发者ID:jembi,项目名称:openxds,代码行数:11,代码来源:XDSRawXMLInOutMessageReceiver.java

示例2: dispatchResponse

import org.apache.axis2.context.MessageContext; //导入方法依赖的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);
    }
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:24,代码来源:CarbonEventingMessageReceiver.java

示例3: createMessageContext

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
private MessageContext createMessageContext(OperationContext oc, ConfigurationContext cc,
                                                int flowType) throws Exception {
        MessageContext mc = cc.createMessageContext();

        mc.setFLOW(flowType);
        mc.setTransportIn(transportIn);
        mc.setTransportOut(transportOut);

        mc.setServerSide(true);
//        mc.setProperty(MessageContext.TRANSPORT_OUT, System.out);

        SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
        mc.setEnvelope(omFac.getDefaultEnvelope());

        AxisOperation axisOperation = oc.getAxisOperation();
        String action = axisOperation.getName().getLocalPart();
        mc.setSoapAction(action);
//        System.out.flush();

        mc.setMessageID(UUIDGenerator.getUUID());

        axisOperation.registerOperationContext(mc, oc);
        mc.setOperationContext(oc);

        ServiceContext sc = oc.getServiceContext();
        mc.setServiceContext(sc);

        mc.setTo(new EndpointReference("axis2/services/NullService"));
        mc.setWSAAction("DummyOp");

        AxisMessage axisMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        mc.setAxisMessage(axisMessage);

        return mc;
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:36,代码来源:MessageContextSaveCTest.java

示例4: createMessageContext

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
private MessageContext createMessageContext(OperationContext oc) throws Exception {
        MessageContext mc = configurationContext.createMessageContext();
        mc.setTransportIn(transportIn);
        mc.setTransportOut(transportOut);

        mc.setServerSide(true);
//        mc.setProperty(MessageContext.TRANSPORT_OUT, System.out);

        SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
        mc.setEnvelope(omFac.getDefaultEnvelope());

        AxisOperation axisOperation = oc.getAxisOperation();
        String action = axisOperation.getName().getLocalPart();
        mc.setSoapAction(action);
//        System.out.flush();

        mc.setMessageID(UUIDGenerator.getUUID());

        axisOperation.registerOperationContext(mc, oc);
        mc.setOperationContext(oc);

        ServiceContext sc = oc.getServiceContext();
        mc.setServiceContext(sc);

        mc.setTo(new EndpointReference("axis2/services/NullService"));
        mc.setWSAAction("DummyOp");

        AxisMessage axisMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        mc.setAxisMessage(axisMessage);

        return mc;
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:33,代码来源:MessageContextSaveBTest.java

示例5: testFindOperation

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public void testFindOperation() throws Exception {
    MessageContext messageContext = new MessageContext();
    AxisService as = new AxisService("Service1");
    messageContext.setAxisService(as);

    AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
    ArrayList op1actions = new ArrayList();
    op1actions.add("urn:org.apache.axis2.dispatchers.test:operation1");
    operation1.setWsamappingList(op1actions);

    AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
    ArrayList op2actions = new ArrayList();
    op2actions.add("urn:org.apache.axis2.dispatchers.test:operation2");
    operation2.setWsamappingList(op2actions);

    as.addOperation(operation1);
    as.addOperation(operation2);

    as.mapActionToOperation("urn:org.apache.axis2.dispatchers.test:operation1", operation1);
    as.mapActionToOperation("urn:org.apache.axis2.dispatchers.test:operation2", operation2);

    messageContext.setWSAAction("urn:org.apache.axis2.dispatchers.test:operation2");

    ActionBasedOperationDispatcher abod = new ActionBasedOperationDispatcher();
    abod.invoke(messageContext);
    assertEquals(operation2, messageContext.getAxisOperation());
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:ActionBasedOperationDispatchTest.java

示例6: testAddToSOAPHeader

import org.apache.axis2.context.MessageContext; //导入方法依赖的package包/类
public void testAddToSOAPHeader() throws Exception {
    EndpointReference replyTo = new EndpointReference(
            "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous");
    EndpointReference epr = new EndpointReference("http://www.to.org/service/");

    for (int i = 0; i < 5; i++) {
        epr.addReferenceParameter(
                new QName(Submission.WSA_NAMESPACE, "Reference" + i,
                          AddressingConstants.WSA_DEFAULT_PREFIX),
                "Value " + i * 100);

    }


    SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
    SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();

    ConfigurationContext configCtx =
            ConfigurationContextFactory.createEmptyConfigurationContext();
    MessageContext msgCtxt = configCtx.createMessageContext();
    msgCtxt.setProperty(WS_ADDRESSING_VERSION, Submission.WSA_NAMESPACE);
    msgCtxt.setTo(epr);
    msgCtxt.setReplyTo(replyTo);
    msgCtxt.setEnvelope(defaultEnvelope);
    msgCtxt.setWSAAction("http://www.actions.org/action");
    msgCtxt.setMessageID("urn:test:123");

    OMAttribute extAttr = OMAbstractFactory.getOMFactory().createOMAttribute("AttrExt",
                                                                             OMAbstractFactory
                                                                                     .getOMFactory().createOMNamespace(
                                                                                     "http://ws.apache.org/namespaces/axis2",
                                                                                     "axis2"),
                                                                             "123456789");
    ArrayList al = new ArrayList();
    al.add(extAttr);

    msgCtxt.setProperty(AddressingConstants.ACTION_ATTRIBUTES, al);
    msgCtxt.setProperty(AddressingConstants.MESSAGEID_ATTRIBUTES, al);

    outHandler.invoke(msgCtxt);

    OMXMLParserWrapper omBuilder = TestUtil.getOMBuilder("eprTest.xml");

    XMLUnit.setIgnoreWhitespace(true);
    assertXMLEqual(omBuilder.getDocumentElement().toString(), defaultEnvelope.toString());

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:48,代码来源:AddressingOutHandlerTest.java


注:本文中的org.apache.axis2.context.MessageContext.setWSAAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。