Package org.apache.axis2.client

Examples of org.apache.axis2.client.OperationClient.addMessageContext()


        requestContext.setEnvelope(envelope);

        ServiceClient sender = new ServiceClient(configContext, clientService);
        sender.setOptions(options);
        OperationClient opClient = sender.createClient(new QName("echoOMElement"));
        opClient.addMessageContext(requestContext);
        opClient.setOptions(options);
        opClient.execute(true);

        MessageContext response = opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        SOAPEnvelope env = response.getEnvelope();
View Full Code Here


    private static MessageContext sendReceive(OMElement llomElement, ServiceClient serviceClient)
            throws AxisFault {
        MessageContext messageContext = new MessageContext();
        fillSOAPEnvelope(messageContext, llomElement, serviceClient);
        OperationClient operationClient = serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP);
        operationClient.addMessageContext(messageContext);
        operationClient.execute(true);
        MessageContext response = operationClient
                .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        if (serviceClient.getOptions().isCallTransportCleanup()) {
            response.getEnvelope().build();
View Full Code Here

               
        EndpointReference epr = new EndpointReference("http://127.0.0.1:6060/axis2/services/WSTransferSampleService");
        options.setTo(epr);
       
        MessageContext msgCtx = new MessageContext();
        opClient.addMessageContext(msgCtx);
       
        SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
        SOAPEnvelope env = factory.getDefaultEnvelope();
       
        Customer customer = new Customer();
View Full Code Here

        options.setAction(WSTransferConstants.ACTION_URI_GET);
       
        env = factory.getDefaultEnvelope();
       
        msgCtx = new MessageContext();
        opClient.addMessageContext(msgCtx);
       
        env.getHeader().addChild(customerIdHeader);
        msgCtx.setEnvelope(env);
       
        opClient.execute(true);
View Full Code Here

            }
        } else {
            requestMC.setTo(new EndpointReference(options.getTo().getAddress()));
        }

        operationClient.addMessageContext(requestMC);

        return operationClient;
    }
   
    public boolean allowsPassByReference() {
View Full Code Here

        // Allow privileged access to read properties. Requires PropertiesPermission read in
        // security policy.
        try {
            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                public Object run() throws AxisFault {
                    operationClient.addMessageContext(requestMC);
                    return null;
                }
            });
        } catch (PrivilegedActionException e) {
            throw (AxisFault)e.getException();
View Full Code Here

        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
        options.setExceptionToBeThrownOnSOAPFault(false);
        MessageContext msgctx = new MessageContext();
        msgctx.setEnvelope(inEnvelope);
        OperationClient opClient = client.createClient(ServiceClient.ANON_OUT_IN_OP);
        opClient.addMessageContext(msgctx);
        opClient.execute(true);
        return opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope();
    }

    public File getTestResourceFile(String relativePath) {
View Full Code Here

        requestContext.setEnvelope(envelope);

        ServiceClient sender = new ServiceClient(configContext, clientService);
        sender.setOptions(options);
        OperationClient opClient = sender.createClient(new QName("echoOMElement"));
        opClient.addMessageContext(requestContext);
        opClient.setOptions(options);
        opClient.execute(true);

        MessageContext response = opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        SOAPEnvelope env = response.getEnvelope();
View Full Code Here

        mc.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, options.getCharset());
        mc.setServiceContext(serviceClient.getServiceContext());
        if (metrics != null) {
            mc.setProperty(BaseConstants.METRICS_COLLECTOR, metrics);
        }
        mepClient.addMessageContext(mc);
        mepClient.execute(block);
        mepClient.complete(mc);
        return resultMessageLabel == null ? null : mepClient.getMessageContext(resultMessageLabel);
    }
View Full Code Here

        requestContext.setEnvelope(envelope);

        ServiceClient sender = new ServiceClient(configContext, clientService);
        sender.setOptions(options);
        OperationClient opClient = sender.createClient(new QName("echoOMElement"));
        opClient.addMessageContext(requestContext);
        opClient.setOptions(options);
        opClient.execute(true);

        MessageContext response = opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        SOAPEnvelope env = response.getEnvelope();
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.