Package org.apache.axis2.context

Examples of org.apache.axis2.context.ConfigurationContext.createMessageContext()


    }

    public void testSOAP12RoleSupport() throws Exception {
        ConfigurationContext cfgCtx =
                ConfigurationContextFactory.createEmptyConfigurationContext();
        msgCtxt = cfgCtx.createMessageContext();

        msgCtxt.setProperty(AddressingConstants.SOAP_ROLE_FOR_ADDRESSING_HEADERS,
                            "urn:test:role");

        EndpointReference epr = new EndpointReference("http://www.from.org/service/");
View Full Code Here


        EndpointReference eprOne = new EndpointReference("http://whatever.org");
        EndpointReference duplicateEpr = new EndpointReference("http://whatever.duplicate.org");
        RelatesTo reply = new RelatesTo("urn:id");
        ConfigurationContext cfgCtx =
                ConfigurationContextFactory.createEmptyConfigurationContext();
        msgCtxt = cfgCtx.createMessageContext();
        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
        msgCtxt.setEnvelope(defaultEnvelope);

        msgCtxt.addRelatesTo(reply);
View Full Code Here

        // this will check whether we can add to epr, if there is one already.
        EndpointReference eprOne = new EndpointReference("http://whatever.org");
        RelatesTo custom = new RelatesTo("urn:id", "customRelationship");
        ConfigurationContext cfgCtx =
                ConfigurationContextFactory.createEmptyConfigurationContext();
        msgCtxt = cfgCtx.createMessageContext();
        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
        OMNamespace addressingNamespace =
                factory.createOMNamespace(Final.WSA_NAMESPACE, WSA_DEFAULT_PREFIX);
        SOAPHeaderBlock soapHeaderBlock =
View Full Code Here

        // this will check whether we can add to epr, if there is one already.
        EndpointReference eprOne = new EndpointReference("http://whatever.org");
        RelatesTo custom = new RelatesTo("urn:id", "customRelationship");
        ConfigurationContext cfgCtx =
                ConfigurationContextFactory.createEmptyConfigurationContext();
        msgCtxt = cfgCtx.createMessageContext();
        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
        OMNamespace addressingNamespace =
                factory.createOMNamespace(Final.WSA_NAMESPACE, WSA_DEFAULT_PREFIX);
        SOAPHeaderBlock soapHeaderBlock =
View Full Code Here

        ConfigurationContext cc = null;
        try {
            cc = ConfigurationContextFactory.createEmptyConfigurationContext();
            AxisConfiguration ac = cc.getAxisConfiguration();
            ac.addService(as1);
            messageContext = cc.createMessageContext();
            messageContext.setAxisService(as1);

            SOAPEnvelope se = soapFactory.createSOAPEnvelope();

            SOAPHeader sh = soapFactory.createSOAPHeader(se);
View Full Code Here

public class SOAPActionBasedDispatcherTest extends TestCase {

    public void testFindOperation() throws Exception {
        ConfigurationContext cc = new ConfigurationContext(new AxisConfiguration());
        MessageContext messageContext = cc.createMessageContext();
        AxisService as = new AxisService("Service1");
        messageContext.setAxisService(as);

        AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
        operation1.setSoapAction("urn:org.apache.axis2.dispatchers.test:operation1");
View Full Code Here

        axisService.addOperation(axisOperation);
        axisConfiguration.addService(axisService);
        ConfigurationContext configurationContext = new ConfigurationContext(axisConfiguration);

        // Make addressing required using the same property as the AddressingConfigurator on the request
        MessageContext request = configurationContext.createMessageContext();
        request.setProperty(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER, AddressingConstants.ADDRESSING_REQUIRED);
       
        // Create a response to invoke the in handler on       
        MessageContext response = configurationContext.createMessageContext();
View Full Code Here

        as1.addOperation(operation2);

        ConfigurationContext cc = ConfigurationContextFactory.createEmptyConfigurationContext();
        AxisConfiguration ac = cc.getAxisConfiguration();
        ac.addService(as1);
        messageContext = cc.createMessageContext();

        messageContext.setAxisService(as1);

        SOAPEnvelope se = OMAbstractFactory.getSOAP11Factory().createSOAPEnvelope();
        SOAPBody sb = OMAbstractFactory.getSOAP11Factory().createSOAPBody(se);
View Full Code Here

        RequestURIBasedServiceDispatcher ruisd = new RequestURIBasedServiceDispatcher();

        /**
         * Tests for global services
         */
        messageContext = cc.createMessageContext();
        messageContext.setTo(new EndpointReference("http://127.0.0.1:8080" +
                "/axis2/services/Service2"));
        ruisd.invoke(messageContext);
        assertEquals(as2, messageContext.getAxisService());

View Full Code Here

                "/axis2/services/Service2"));
        ruisd.invoke(messageContext);
        assertEquals(as2, messageContext.getAxisService());

        //service/operation scenario
        messageContext = cc.createMessageContext();
        messageContext.setTo(new EndpointReference("http://127.0.0.1:8080" +
                "/axis2/services/Service2/getName"));
        ruisd.invoke(messageContext);
        assertEquals(as2, messageContext.getAxisService());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.