Package org.apache.axis2.client

Examples of org.apache.axis2.client.Options


    // Run a ping test with sync acks - this should work even though MakeConnection is disabled
    runPing(false, false);
   
    // Run an echo test with sync acks - this should fail as MakeConnection is disabled
    AxisFault fault = null;
    Options clientOptions = new Options();
    clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);
    try {
      runEcho(clientOptions, false, false, false, false, true);
    } catch (AxisFault e) {
      fault = e;
      //System.out.println("Caught expected fault: " + e);
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);
    ServiceClient serviceClient = new ServiceClient (configContext,null);

    Options clientOptions = new Options ();
    clientOptions.setAction(pingAction);
    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(SandeshaClientConstants.UNRELIABLE_MESSAGE, "true");
    serviceClient.setOptions(clientOptions);
   
    serviceClient.fireAndForget(getPingOMBlock("echo1"));
   
    //assertions for the out sequence.
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);
    ServiceClient serviceClient = new ServiceClient (configContext,null);

    Options clientOptions = new Options ();
    clientOptions.setAction(echoAction);
    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(SandeshaClientConstants.UNRELIABLE_MESSAGE,"true");
    serviceClient.setOptions(clientOptions);
   
    OMElement result = serviceClient.sendReceive(getEchoOMBlock("echo1", "sync"));
   
    // Check the response
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);
    ServiceClient serviceClient = new ServiceClient (configContext,null);

    Options clientOptions = new Options ();
    clientOptions.setAction(echoAction);
    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(SandeshaClientConstants.UNRELIABLE_MESSAGE,"true");
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    clientOptions.setUseSeparateListener(true);
    serviceClient.setOptions(clientOptions);
   
    TestCallback callback1 = new TestCallback ("Callback 1");
    serviceClient.sendReceiveNonBlocking (getEchoOMBlock("echo1", "async"),callback1);
View Full Code Here

        }
       
        ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], null);
       
        ServiceClient client = new ServiceClient(ctx, null);
        Options options = new Options();
        options.setAction("urn:echo");
        options.setTo(new EndpointReference(args[0]));
        options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,  loadPolicy(args[2]));
        client.setOptions(options);
       
        client.engageModule("addressing");
        client.engageModule("rampart");
View Full Code Here

    }

    public OMElement testEchoXMLSync(String fileName) throws Exception {

        OMElement payload = createEnvelope(fileName);
        Options options = new Options();

        options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        options.setTo(targetEPR);
        // enabling MTOM in the client side
        options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_FALSE);
        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

        ServiceClient sender = new ServiceClient();
        sender.setOptions(options);
        return sender.sendReceive(payload);
    }
View Full Code Here

        }
       
        ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], null);
       
        ServiceClient client = new ServiceClient(ctx, null);
        Options options = new Options();
        options.setAction("urn:echo");
        options.setTo(new EndpointReference(args[0]));
        options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,  loadPolicy(args[2]));
        client.setOptions(options);
       
        client.engageModule("addressing");
        client.engageModule("rampart");
View Full Code Here

        ServiceClient client = null;
        QName serviceName = null;

        try {
            client = new ServiceClient();
            Options options = new Options();
            EndpointReference endPoint = new EndpointReference(this.getLocation(modelService));
            options.setTo(endPoint);
            client.setOptions(options);
        } catch (AxisFault e) {
            throw new GenericServiceException("RPC service error", e);
        }
View Full Code Here

        String portName = wsPortMetaData.getPortName().getLocalPart();

        ServiceClient serviceClient;
        try {

            AxisService axisService = AxisService.createClientSideAxisService(wsdlDefinition, serviceQName, portName, new Options());
            serviceClient = new ServiceClient(configurationContext, axisService);

        } catch (AxisFault e) {
            BuilderConfigException bce = new BuilderConfigException("AxisFault creating external service", e);
            bce.addContextName(externalServiceName);
View Full Code Here

            WebServiceOperationMetaData operationMetaData = wsPortMetaData.getOperationMetaData(methodName);
            boolean isWrapped = operationMetaData.isDocLitWrapped();
            List<?> sig = operationMetaData.getOperationSignature();
            SDODataBinding dataBinding = new SDODataBinding(cl, typeHelper, sig.size() > 0 ? (QName) sig.get(0) : null, isWrapped);

            Options options = new Options();
            options.setTo(new EndpointReference(wsPortMetaData.getEndpoint()));
            options.setProperty(MessageContextConstants.CHUNKED, Boolean.FALSE);

            String wsdlOperationName = operationMetaData.getBindingOperation().getOperation().getName();

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

            QName wsdlOperationQName = new QName(portTypeNS, wsdlOperationName);
            Axis2OperationInvoker invoker = new Axis2OperationInvoker(wsdlOperationQName, options, dataBinding, soapFactory);
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.