org.apache.axis2.client.Options - Operation Client Options

This section describes 3 other Axis2 classes: org.apache.axis2.description.AxisService, org.apache.axis2.client.Options and org.apache.axis2.addressing.EndpointReference.

Once we have a ServiceClient object created, we can learn 3 other related classes.

1. org.apache.axis2.description.AxisService - A class represents a Web service itself.

2. org.apache.axis2.client.Options - A class represents a holder for operation client options. It is used by the other classes in this package to configure various aspects of how a client communicates with a service.

3. org.apache.axis2.addressing.EndpointReference - A class models the WS-A EndpointReferenceType. But it can be used without any WS-A handlers as well since the models for this in Submission and Final versions are different.

Here is a test program that shows some properties of these classes:

 * Copyright (c) 2009 All Rights Reserved.
import javax.xml.namespace.QName;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.client.Options;
import org.apache.axis2.addressing.EndpointReference;
class Axis2ServiceClientGetMethod {
   public static void main(String[] args) {
      PrintStream out = System.out;

// Setting initial values
      String server = "";
      String wsdl = server+"Hello_WSDL_11_SOAP.wsdl";
      String tns = "";
      String serviceName = "helloService";
      String portName = "helloPort";

      try {

// Creating a dynamic service client with a given WSDL
         ServiceClient client = new ServiceClient(
            new URL(wsdl),
            new QName(tns, serviceName),

// Printing AxisService object information
         AxisService service = client.getAxisService();
         out.println("AxisService object information:");
         out.println("   service: "+service);
         out.println("   service.getCustomSchemaNamePrefix(): "
         out.println("   service.getFileName(): "
         out.println("   service.getName(): "

// getServiceDescription() is replaced by getDocumentation()
//         out.println("   service.getServiceDescription(): "
//            +service.getServiceDescription());
         out.println("   service.getDocumentation(): "

         out.println("   service.getSoapNsUri(): "
         out.println("   service.getTargetNamespace(): "
         out.println("   service.getTargetNamespacePrefix(): "

// Printing Options object information
         Options options = client.getOptions();
         out.println("Options object information:");
         out.println("   options: "+options);
         out.println("   options.getAction(): "
         out.println("   options.getSoapVersionURI(): "
         out.println("   options.getTransportInProtocol(): "

// Printing EndpointReference object information
         EndpointReference endpoint = options.getTo();
         out.println("EndpointReference object information:");
         out.println("   endpoint: "+endpoint);
         out.println("   endpoint.getAddress(): "
         out.println("   endpoint.getName(): "

      } catch (Exception e) {

Execution of this program is described below:

herong> java -cp .;\local\axis2\lib\* Axis2ServiceClientGetMethod

AxisService object information:
   service: helloService
   service.getCustomSchemaNamePrefix(): null
   service.getFileName(): null
   service.getName(): helloService
    Copyright (c) by Herong Yang.
    All rights reserved

   service.getSoapNsUri(): null
   service.getTargetNamespacePrefix(): tns

Options object information:
   options: org.apache.axis2.client.Options@148bd3
   options.getAction(): null
   options.getTransportInProtocol(): null

EndpointReference object information:
   endpoint.getName(): null

Notes on the test program code and output:

Table of Contents

 About This Book

 Introduction to WSDL 2.0

 WSDL 2.0 Document Structure and Syntax

 WSDL Version 2.0 Part 2: Adjuncts

 WSDL 2.0 Document Examples with SOAP Binding

 Using WSDL Document in Java Apache Axis2/Java for WSDL

 Apache Woden for WSDL Documents in Java

 SoapUI - Web Service Testing Tool

 PHP SOAP Extension for WSDL

 Perl SOAP::Lite for WSDL

 Introduction to WSDL 1.1

 WSDL 1.1 Document Structure and Syntax

 WSDL 1.1 Binding Extension for SOAP 1.1

 SoapUI as WSDL 1.1 Testing Tool

 WSDL 1.1 and SOAP 1.1 Examples - Document and RPC Styles

 PHP SOAP Extension for WSDL 1.1

 Perl SOAP::Lite for WSDL 1.1

Apache Axis2/Java for WSDL 1.1

 Creating Service Client with WSDL 1.1 Document

org.apache.axis2.client.Options - Operation Client Options

 sendReceive() Method - Invoking a Named Operation

 Turning Off the Chunked HTTP Flag

 AXIOM (AXIs Object Model) - document/literal Style

 org.apache.axis2.rpc.client.RPCServiceClient Class - rpc/encoded Style - Socket Server Testing Program

 Capturing the HTTP Request from an Axis2 Client Program

 Using WSDL2Java to Generate Web Service Stub Classes

 WSDL 1.1 Binding Extension for SOAP 1.2

 WSDL 1.1 and SOAP 1.2 Examples - Document and RPC Styles

 SOAP 1.2 Binding - PHP, Java and Perl Clients

 Python SOAP Client: Zeep

 WSDL Related Terminologies

 Archived Tutorials


 Full Version in PDF/EPUB