Package org.apache.axis2.client

Examples of org.apache.axis2.client.Options


      String repoPath = "target" + File.separator + "repos" + File.separator + "client";
      String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
     
      ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
     
      Options clientOptions = new Options ();
      clientOptions.setAction(pingAction);
      clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
       clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,
           Sandesha2Constants.SPEC_VERSIONS.v1_1);
      clientOptions.setTo(new EndpointReference (to));
     
      String sequenceKey = "some_sequence_key";
      clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
     
      ServiceClient serviceClient = new ServiceClient (configContext,null);
     
      String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
      clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
      clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
        //serviceClient.
      serviceClient.setOptions(clientOptions);
       
      try{
       
View Full Code Here


    String repoPath = "target" + File.separator + "repos" + File.separator + "client";
    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
   
    Options clientOptions = new Options ();
    clientOptions.setAction(pingAction);
    clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
     clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,
         Sandesha2Constants.SPEC_VERSIONS.v1_1);
    clientOptions.setTo(new EndpointReference (to));
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);
   
    String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
    clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
      //serviceClient.
    serviceClient.setOptions(clientOptions);
     
    try{
      // 1) Send the application message
View Full Code Here

    String repoPath = "target" + File.separator + "repos" + File.separator + "client";
    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);

    Options clientOptions = new Options ();

    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(Configuration.TRANSPORT_URL,transportTo);
       
    ServiceClient serviceClient = new ServiceClient (configContext,null);
   
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION, Sandesha2Constants.SPEC_VERSIONS.v1_1);
    clientOptions.setUseSeparateListener(true);
   
    serviceClient.setOptions(clientOptions);
       
    // Create a sequence
    SandeshaClient.createSequence(serviceClient, false, null);
View Full Code Here

    String repoPath = "target" + File.separator + "repos" + File.separator + "client";
    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);

    Options clientOptions = new Options ();
    clientOptions.setAction(echoAction);
    clientOptions.setTo(new EndpointReference (to));
   
    String sequenceKey = SandeshaUtil.getUUID();
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);
   
    String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
    clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
   
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
   
    String offeredSequenceID = SandeshaUtil.getUUID();
    clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,offeredSequenceID);
   
    serviceClient.setOptions(clientOptions);
    //serviceClient.
   
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    clientOptions.setUseSeparateListener(true);
   
    serviceClient.setOptions(clientOptions);
   
   
    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    TestCallback callback1 = new TestCallback ("Callback 1");
    serviceClient.sendReceiveNonBlocking (getEchoOMBlock("echo1",sequenceKey),callback1);
       
    long limit = System.currentTimeMillis() + waitTime;
    Error lastError = null;
View Full Code Here

    String repoPath = "target" + File.separator + "repos" + File.separator + "client";
    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);   
   
    Options clientOptions = new Options ();
    clientOptions.setAction(echoAction);
    clientOptions.setTo(new EndpointReference (to));

    String sequenceKey = SandeshaUtil.getUUID();
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);
   

    HashMap axisServices = configContext.getAxisConfiguration().getServices();
   
    AxisService service = null;
    Iterator values = axisServices.values().iterator();
    while(values.hasNext())
      service = (AxisService)values.next();

    // Set the Sequence timout property to 1 second.
    Iterator operations = service.getOperations();
   
    while (operations.hasNext())
    {
      AxisOperation op = (AxisOperation) operations.next();
      SandeshaPolicyBean propertyBean =
        SandeshaUtil.getPropertyBean(op);

      // Indicate that the sequence should timeout after 1 second
      if (propertyBean != null)
        propertyBean.setInactiveTimeoutInterval(1, "seconds");
    }
   
    // Set a bad acks to so the CreateSequence will be refused.
    String acksTo = AddressingConstants.Final.WSA_NONE_URI;
    clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
   
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    clientOptions.setUseSeparateListener(true);   
    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.setOptions(clientOptions);   
   
    TestCallback callback1 = new TestCallback ("Callback 1");
    serviceClient.sendReceiveNonBlocking (getEchoOMBlock("echo1",sequenceKey),callback1);
       
View Full Code Here

    String repoPath = "target" + File.separator + "repos" + File.separator + "client";
    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);   
   
    Options clientOptions = new Options ();
    clientOptions.setAction(echoAction);
    clientOptions.setTo(new EndpointReference (to));

    String sequenceKey = SandeshaUtil.getUUID();
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);   

    HashMap axisServices = configContext.getAxisConfiguration().getServices();
   
    AxisService service = null;
    Iterator values = axisServices.values().iterator();
    while(values.hasNext())
      service = (AxisService)values.next();

    // Set the Sequence timout property to 1 second.
    Iterator operations = service.getOperations();
   
    while (operations.hasNext())
    {
      AxisOperation op = (AxisOperation) operations.next();
      SandeshaPolicyBean propertyBean =
        SandeshaUtil.getPropertyBean(op);

      // Indicate that the sequence should timeout after 1 second
      // And that it should be deleted after 2 seconds
      if (propertyBean != null) {
        propertyBean.setInactiveTimeoutInterval(1, "seconds");
        propertyBean.setSequenceRemovalTimeoutInterval(2, "seconds");
      }
    }
   
    // Set a bad acks to so the CreateSequence will be refused.
    String acksTo = AddressingConstants.Final.WSA_NONE_URI;
    clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
   
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    clientOptions.setUseSeparateListener(true);   
    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.setOptions(clientOptions);   
   
    TestCallback callback1 = new TestCallback ("Callback 1");
    serviceClient.sendReceiveNonBlocking (getEchoOMBlock("echo1",sequenceKey),callback1);
       
View Full Code Here

    String repoPath = "target" + File.separator + "repos" + File.separator + "client";
    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);   
   
    Options clientOptions = new Options ();
    clientOptions.setAction(pingAction);
    clientOptions.setTo(new EndpointReference (to));

    String sequenceKey = SandeshaUtil.getUUID();
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);
    serviceClient.setOptions(clientOptions);

    HashMap axisServices = serverConfigContext.getAxisConfiguration().getServices();
View Full Code Here

    runPing(true, true);
  }

  public void testAsyncEcho() throws Exception {
    // Test async echo with sync acks
    Options clientOptions = new Options();
    runEcho(clientOptions, true, false, false,true,false);
   
    // Test async echo with async acks
    clientOptions = new Options();
    runEcho(clientOptions, true, true, false,true,false);
   
    // Test async echo with async acks and offer
    clientOptions = new Options();
    clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());
    runEcho(clientOptions, true, true, false,true,true);
  }
View Full Code Here

    runEcho(clientOptions, true, true, false,true,true);
  }
   
  public void testSyncEcho() throws Exception {
    // Test sync echo with an offer, and the 1.1 spec
    Options clientOptions = new Options();
    clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());
    clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);
    runEcho(clientOptions, false, false, true,true,false);
   
//    // Test sync echo with an offer, and the 1.0 spec. The offer is not automatic as this
//    // is a client that hasn't been built from WSDL. If the user's operations had been
//    // modelled properly then the offer would happen automatically.
//    clientOptions = new Options();
//    clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID());
//    clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_0);
//    runEcho(clientOptions, false, false, true,false,false);

    // Test sync echo with no offer, and the 1.1 spec
    clientOptions = new Options();
    clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1);
    runEcho(clientOptions, false, false, true,true,true);
  }
View Full Code Here

    runEcho(clientOptions, false, false, true,true,true);
  }

  public void runPing(boolean asyncAcks, boolean stopListener) throws Exception {
   
    Options clientOptions = new Options();

    ServiceClient serviceClient = new ServiceClient (configContext,null);
    serviceClient.setOptions(clientOptions);

    String sequenceKey = SandeshaUtil.getUUID();

    clientOptions.setAction(pingAction);
    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
   
    if(asyncAcks) {
      String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
      clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
      clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
      clientOptions.setUseSeparateListener(true);
    }

    serviceClient.fireAndForget(getPingOMBlock("ping1"));
   
    long limit = System.currentTimeMillis() + waitTime;
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.