Package org.apache.axis2.client

Examples of org.apache.axis2.client.Options


        // get a reference to the DYNAMIC operation of the Anonymous Axis2 service
        AxisOperation axisAnonymousOperation = anoymousService.getOperation(
            new QName(AnonymousServiceFactory.DYNAMIC_OPERATION));

        Options clientOptions = new Options();
        clientOptions.setUseSeparateListener(separateListener);
        // if RM is requested,
        if (wsRMEnabled) {
            // if a WS-RM policy is specified, use it
            if (wsRMPolicyKey != null) {
                clientOptions.setProperty(
                    org.apache.synapse.config.xml.Constants.SANDESHA_POLICY,
                    getPolicy(synapseOutMessageContext, wsRMPolicyKey));
            }


            // always send each and every message in a new sequence and terminate sequence
            //clientOptions.setProperty("Sandesha2LastMessage", "true");
        }

        // if security is enabled,
        if (wsSecurityEnabled) {
            // if a WS-Sec policy is specified, use it
            if (wsSecPolicyKey != null) {
                clientOptions.setProperty(
                    org.apache.synapse.config.xml.Constants.RAMPART_POLICY,
                    getPolicy(synapseOutMessageContext, wsSecPolicyKey));
            }
        }
        OperationClient mepClient = axisAnonymousOperation.createClient(
            serviceCtx, clientOptions);
        mepClient.addMessageContext(axisOutMsgCtx);

        if (clientOptions.isUseSeparateListener()) {
            mepClient.setCallback(new AsyncCallback(synapseOutMessageContext));
            axisOutMsgCtx.getOperationContext().setProperty(
                org.apache.axis2.Constants.RESPONSE_WRITTEN, "SKIP");
            mepClient.execute(false);
            return null;
View Full Code Here


                        }
                    }
                }
            }
           
            axisClientSideService = Axis2EngineIntegration.createClientSideAxisService(definition, serviceQName, port.getName(), new Options());
   
            HttpClient httpClient = (HttpClient)configContext.getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
            if (httpClient == null) {
                MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
                HttpConnectionManagerParams connectionManagerParams = new HttpConnectionManagerParams();
View Full Code Here

    public boolean supportsOneWayInvocation() {
        return true;
    }

    public Invoker createInvoker(Operation operation) {
        Options options = new Options();
        org.apache.axis2.addressing.EndpointReference epTo = getWSATOEPR(wsBinding);
        if (epTo != null) {
            options.setTo(epTo);
        }
        options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);

        String operationName = operation.getName();

        String soapAction = getSOAPAction(operationName);
        if (soapAction != null && soapAction.length() > 1) {
            options.setAction(soapAction);
        }

        options.setTimeOutInMilliSeconds(30 * 1000); // 30 seconds

        // Allow privileged access to read properties. Requires PropertiesPermission read in
        // security policy.
        SOAPFactory soapFactory = AccessController.doPrivileged(new PrivilegedAction<SOAPFactory>() {
            public SOAPFactory run() {
                if (isSOAP12Required)
                    return OMAbstractFactory.getSOAP12Factory();
                else
                    return OMAbstractFactory.getSOAP11Factory();

            }
        });
        QName wsdlOperationQName = new QName(operationName);
        if (isMTOMRequired)
        {
            options.setProperty(org.apache.axis2.Constants.Configuration.ENABLE_MTOM, org.apache.axis2.Constants.VALUE_TRUE);
        }
       
        return new Axis2ReferenceBindingInvoker(endpointReference, serviceClient, wsdlOperationQName, options, soapFactory, wsBinding);
       
/*       
View Full Code Here

    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";

    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);

    //clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    Options clientOptions = new Options ();
    clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
   
    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportTo);
   
    String sequenceKey = "sequence1";
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    //setting the addressing version as submission
    clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_0);

    ServiceClient serviceClient = new ServiceClient (configContext,null);
    //serviceClient.
   
    serviceClient.setOptions(clientOptions);
   
    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping3"));

    Thread.sleep(10000);
       
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
View Full Code Here

    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";

    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);

    //clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    Options clientOptions = new Options ();
    clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
   
    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportTo);
   
    String sequenceKey = "sequence1";
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    //setting the RM version as OASIS.
    clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);
    //serviceClient.
   
    serviceClient.setOptions(clientOptions);
View Full Code Here

    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";

    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);

    //clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    Options clientOptions = new Options ();
    clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
   
    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportTo);
   
    String sequenceKey = "sequence1";
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    //setting the addressing version as Final
    clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Final.WSA_NAMESPACE);

    ServiceClient serviceClient = new ServiceClient (configContext,null);
    //serviceClient.
   
    serviceClient.setOptions(clientOptions);
   
    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping3"));

    Thread.sleep(10000);
       
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
View Full Code Here

    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";

    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);

    //clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    Options clientOptions = new Options ();
    clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
   
    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportTo);
   
    String sequenceKey = "sequence1";
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    //setting the addressing version as Submission
    clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);

    ServiceClient serviceClient = new ServiceClient (configContext,null);
    //serviceClient.
   
    serviceClient.setOptions(clientOptions);
   
    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping3"));

    Thread.sleep(10000);
       
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
View Full Code Here

    
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);

    ServiceClient serviceClient = new ServiceClient (configContext,null)
   
    Options clientOptions = new Options ();
   
    EndpointReference toEPR = new EndpointReference (toAddress);
    populateToEPRToRejectOffers(toEPR);
   
//    clientOptions.setManageSession(true); // without this reference params wont go.
    serviceClient.setTargetEPR(toEPR);
   
//    clientOptions.setProperty(Options.COPY_PROPERTIES,new Boolean (true));
    clientOptions.setTo(toEPR);
   
    clientOptions.setAction("urn:wsrm:EchoString");
   
    String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
    clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
   
    String sequenceKey = "sequence4";
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
   
//    clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE);   //uncomment this to send messages without chunking.
//    clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);   //uncomment this to send messages in SOAP 1.2
//    clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
    clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1)//uncomment this to send the messages according to the v1_1 spec.
    clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID())//single characted offers are declined by the server
   
    //You must set the following two properties in the request-reply case.
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    clientOptions.setUseSeparateListener(true);
   
    serviceClient.setOptions(clientOptions);

    Callback callback1 = new TestCallback ("Callback 1");
    serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback1);
View Full Code Here

    ServiceClient stubServiceClient = stub._getServiceClient();
   
    String sequenceKey = "sequence4";
    String acksTo = stubServiceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
   
    Options options = stubServiceClient.getOptions();
    setUpOptions(options, sequenceKey, acksTo);
    populateToEPRToRejectOffers(stub._getServiceClient().getOptions().getTo());
   
    EchoString echoString = new EchoString ();
    echoString.setEchoString (new EchoStringRequestBodyType ());
View Full Code Here

  private void run () throws Exception {
   
    ConfigurationContext configurationContext = getConfigurationContext();
    ServiceClient serviceClient = new ServiceClient (configurationContext,null)
   
    Options clientOptions = new Options ();

    String sequenceKey = "sequence4";
    String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
   
    setUpOptions(clientOptions, sequenceKey,acksTo);
View Full Code Here

TOP

Related Classes of org.apache.axis2.client.Options

Copyright © 2018 www.massapicom. 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.