Save This Page
Home » axis2-1.5-src » org.apache » axis2 » client » [javadoc | source]
org.apache.axis2.client
public class: ServiceClient [javadoc | source]
java.lang.Object
   org.apache.axis2.client.ServiceClient

Direct Known Subclasses:
    MexClient, RPCServiceClient, RMIClient

Client access to a service. Each instance of this class is associated with a particular org.apache.axis2.description.AxisService , and the methods support operations using that service. Options instances are used to configure various aspects of the service access.
Field Summary
protected static final  Log log     
public static final  String ANON_SERVICE    Base name used for a service created without an existing configuration. 
public static final  QName ANON_OUT_ONLY_OP    Operation name used for an anonymous out-only operation (meaning we send a message with no response allowed from the service, equivalent to a WSDL In-Only operation). 
public static final  QName ANON_ROBUST_OUT_ONLY_OP    Operation name used for an anonymous robust-out-only operation (meaning we send a message, with the only possible response a fault, equivalent to a WSDL Robust-In-Only operation). 
public static final  QName ANON_OUT_IN_OP    Operation name used for an anonymous in-out operation (meaning we sent a message and receive a response, equivalent to a WSDL In-Out operation). 
Constructor:
 public ServiceClient() throws AxisFault 
    Create a service client by assuming an anonymous service and any other necessary information.
    Throws:
    AxisFault - in case of error
 public ServiceClient(ConfigurationContext configContext,
    AxisService axisService) throws AxisFault 
    Create a service client configured to work with a specific AxisService. If this service is already in the world that's handed in (in the form of a ConfigurationContext) then I will happily work in it. If not I will create a small little virtual world and live there.
    Parameters:
    configContext - The configuration context under which this service lives (may be null, in which case a new local one will be created)
    axisService - The service for which this is the client (may be null, in which case an anonymous service will be created)
    Throws:
    AxisFault - if something goes wrong while creating a config context (if needed)
 public ServiceClient(ConfigurationContext configContext,
    Definition wsdl4jDefinition,
    QName wsdlServiceName,
    String portName) throws AxisFault 
    This is WSDL4J based constructor to configure the Service Client/ TODO: make this policy aware
    Parameters:
    configContext - active ConfigurationContext
    wsdl4jDefinition - the WSDL we're going to be using to configure ourselves
    wsdlServiceName - QName of the WSDL service we'd like to access
    portName - name of the WSDL port we'd like to access
    Throws:
    AxisFault - in case of error
 public ServiceClient(ConfigurationContext configContext,
    URL wsdlURL,
    QName wsdlServiceName,
    String portName) throws AxisFault 
    Create a service client for WSDL service identified by the QName of the wsdl:service element in a WSDL document.
    Parameters:
    configContext - The configuration context under which this service lives (may be null, in which case a new local one will be created) *
    wsdlURL - The URL of the WSDL document to read
    wsdlServiceName - The QName of the WSDL service in the WSDL document to create a client for
    portName - The name of the WSDL 1.1 port to create a client for. May be null (if WSDL 2.0 is used or if only one port is there). .
    Throws:
    AxisFault - if something goes wrong while creating a config context (if needed)
Method from org.apache.axis2.client.ServiceClient Summary:
addHeader,   addHeader,   addHeadersToEnvelope,   addStringHeader,   cleanup,   cleanupTransport,   createClient,   disengageModule,   disengageModule,   engageModule,   engageModule,   equals,   finalize,   fireAndForget,   fireAndForget,   getAxisConfiguration,   getAxisService,   getLastOperationContext,   getMyEPR,   getOptions,   getOverrideOptions,   getServiceContext,   getTargetEPR,   hashCode,   removeHeaders,   sendReceive,   sendReceive,   sendReceiveNonBlocking,   sendReceiveNonBlocking,   sendReceiveNonBlocking,   sendReceiveNonBlocking,   sendRobust,   sendRobust,   setAxisService,   setCachingOperationContext,   setOptions,   setOverrideOptions,   setTargetEPR
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.axis2.client.ServiceClient Detail:
 public  void addHeader(OMElement header) 
    Add an arbitrary XML element as a header to be sent with outgoing messages.
 public  void addHeader(SOAPHeaderBlock header) 
    Add SOAP Header to be sent with outgoing messages.
 public  void addHeadersToEnvelope(SOAPEnvelope envelope) 
    Add all configured headers to a SOAP envelope.
 public  void addStringHeader(QName headerName,
    String headerText) throws AxisFault 
    Add a simple header containing some text to be sent with interactions.
 public  void cleanup() throws AxisFault 
    Clean up configuration created with this client. Call this method when you're done using the client, in order to discard any associated resources.
 public  void cleanupTransport() throws AxisFault 
 public OperationClient createClient(QName operationQName) throws AxisFault 
    Create an operation client with the appropriate message exchange pattern (MEP). This method creates a full-function MEP client which can be used to exchange messages for a specific operation. It configures the constructed operation client to use the current normal and override options. This method is used internally, and also by generated client stub code.
 public  void disengageModule(QName moduleName) 
Deprecated! Please - use String version instead

    Disengage a module for this service client
 public  void disengageModule(String moduleName) 
    Disengage a module for this service client
 public  void engageModule(QName moduleName) throws AxisFault 
Deprecated! Please - use String version instead

    Engage a module for this service client.
 public  void engageModule(String moduleName) throws AxisFault 
    Engage a module for this service client.
 public boolean equals(Object obj) 
 protected  void finalize() throws Throwable 
 public  void fireAndForget(OMElement elem) throws AxisFault 
    Directly invoke an anonymous operation with an In-Only MEP. This method just sends your supplied XML without the possibility of any response from the service (even an error - though you can still get client-side errors such as "Host not found"). For more control, you can instead create a client for the operation and use that client to execute the send.
 public  void fireAndForget(QName operation,
    OMElement elem) throws AxisFault 
    Directly invoke a named operation with an In-Only MEP. This method just sends your supplied XML without the possibility of any response from the service (even an error - though you can still get client-side errors such as "Host not found"). For more control, you can instead create a client for the operation and use that client to execute the send.
 public AxisConfiguration getAxisConfiguration() 
    Get the AxisConfiguration
 public AxisService getAxisService() 
    Return the AxisService this is a client for. This is primarily useful when the AxisService is created anonymously or from WSDL as otherwise the user had the AxisService to start with.
 public OperationContext getLastOperationContext() 
    Gets the last OperationContext
 public EndpointReference getMyEPR(String transport) throws AxisFault 
    Get the endpoint reference for this client using a particular transport.
 public Options getOptions() 
    Get the basic client configuration from this service interaction.
 public Options getOverrideOptions() 
    Get the client configuration used to override the normal options set by an operation client.
 public ServiceContext getServiceContext() 
    Get the service context.
 public EndpointReference getTargetEPR() 
    Get the endpoint reference for the service.
 public int hashCode() 
 public  void removeHeaders() 
    Remove all headers for outgoing message.
 public OMElement sendReceive(OMElement elem) throws AxisFault 
    Directly invoke an anonymous operation with an In-Out MEP. This method sends your supplied XML and receives a response. For more control, you can instead create a client for the operation and use that client to execute the exchange.
 public OMElement sendReceive(QName operationQName,
    OMElement xmlPayload) throws AxisFault 
    Directly invoke a named operationQName with an In-Out MEP. This method sends your supplied XML and receives a response. For more control, you can instead create a client for the operationQName and use that client to execute the exchange.
 public  void sendReceiveNonBlocking(OMElement elem,
    Callback callback) throws AxisFault 
Deprecated! Please - use the AxisCallback interface rather than Callback, which has been deprecated

    Directly invoke an anonymous operation with an In-Out MEP without waiting for a response. This method sends your supplied XML with response notification to your callback handler. For more control, you can instead create a client for the operation and use that client to execute the exchange.
 public  void sendReceiveNonBlocking(OMElement elem,
    AxisCallback callback) throws AxisFault 
    Directly invoke an anonymous operation with an In-Out MEP without waiting for a response. This method sends your supplied XML with response notification to your callback handler. For more control, you can instead create a client for the operation and use that client to execute the exchange.
 public  void sendReceiveNonBlocking(QName operation,
    OMElement elem,
    Callback callback) throws AxisFault 
Deprecated! Please - use the AxisCallback interface rather than Callback, which has been deprecated

    Directly invoke a named operation with an In-Out MEP without waiting for a response. This method sends your supplied XML with response notification to your callback handler. For more control, you can instead create a client for the operation and use that client to execute the exchange.
 public  void sendReceiveNonBlocking(QName operation,
    OMElement elem,
    AxisCallback callback) throws AxisFault 
    Directly invoke a named operation with an In-Out MEP without waiting for a response. This method sends your supplied XML with response notification to your callback handler. For more control, you can instead create a client for the operation and use that client to execute the exchange.
 public  void sendRobust(OMElement elem) throws AxisFault 
    Directly invoke an anonymous operation with a Robust In-Only MEP. This method just sends your supplied XML and possibly receives a fault. For more control, you can instead create a client for the operation and use that client to execute the send.
 public  void sendRobust(QName operation,
    OMElement elem) throws AxisFault 
    Directly invoke a named operation with a Robust In-Only MEP. This method just sends your supplied XML and possibly receives a fault. For more control, you can instead create a client for the operation and use that client to execute the send.
 public  void setAxisService(AxisService axisService) throws AxisFault 
    Configure the ServiceClient to interact with the Web service described by the specified AxisService object.
 public  void setCachingOperationContext(boolean cachingOpContext) 
Deprecated!
    Sets whether or not to cache the last OperationContext
 public  void setOptions(Options options) 
    Set the basic client configuration related to this service interaction.
 public  void setOverrideOptions(Options overrideOptions) 
    Set a client configuration to override the normal options used by an operation client. Any values set in this configuration will be used for each client, with the standard values for the client still used for any values not set in the override configuration.
 public  void setTargetEPR(EndpointReference targetEpr) 
    Set the endpoint reference for the service.