org.codehaus.xfire.client
Class Client

java.lang.Object
  extended by org.codehaus.xfire.AbstractContext
      extended by org.codehaus.xfire.handler.AbstractHandlerSupport
          extended by org.codehaus.xfire.client.Client
All Implemented Interfaces:
HandlerSupport, ChannelEndpoint

public class Client
extends AbstractHandlerSupport
implements ChannelEndpoint

A SOAP Client. This client can function in two modes.

The first is dynamic mode. In this mode the WSDL is retrieved for a service, a Service model is created from it, and it is used as metadata for the service.

Author:
Dan

Field Summary
static java.lang.String CLIENT_MODE
          This is a variable set on the MessageContext to let particular Handlers know that the invocation is a client invocation.
 
Constructor Summary
protected Client()
           
  Client(Binding binding, java.lang.String url)
          Create a client which uses a particular Binding with a specified URL.
  Client(Binding binding, Transport transport, Service service, java.lang.String url, java.lang.String endpointUri)
          Create a Client on the specified Transport for a Service.
  Client(javax.wsdl.Definition definition, java.lang.Class serviceClass)
          Creates a Client form a WSDL and a service class.
  Client(java.io.InputStream is, java.lang.Class serviceClass)
          Creates a Client form a WSDL and a service class.
  Client(java.lang.String binding, javax.wsdl.Definition definition, java.lang.Class serviceClass)
          Creates a Client form a WSDL, a service class and the specified binding id.
  Client(Transport t, Binding binding, java.lang.String url)
          Create a client which uses a particular Binding with a specified URL and a specified Transport.
  Client(Transport t, Endpoint endpoint)
          Creates a client for a particular Endpoint on a specified Transport.
  Client(Transport transport, Service service, java.lang.String url)
          Create a Client on the specified Transport for a Service.
  Client(Transport transport, Service service, java.lang.String url, java.lang.String endpointUri)
          Create a Client on the specified Transport for a Service.
  Client(java.net.URL wsdlLocation)
           
  Client(java.net.URL wsdlLocation, java.lang.Class serviceClass)
           
 
Method Summary
 void close()
           
 Endpoint findEndpoint(java.lang.String binding, java.util.Collection services)
           
 java.lang.String getEndpointUri()
           
static Client getInstance(java.lang.Object service)
          Return the underlying Client instance for a client Proxy.
 Channel getOutChannel()
           
 Service getService()
           
 int getTimeout()
           
 Transport getTransport()
           
 java.lang.String getUrl()
           
 XFire getXFire()
           
protected  void initFromDefinition(java.lang.String binding, javax.wsdl.Definition definition, java.lang.Class serviceClass)
           
 java.lang.Object[] invoke(OperationInfo op, java.lang.Object[] params)
           
 java.lang.Object[] invoke(java.lang.String name, java.lang.Object[] params)
           
 java.lang.Object[] invoke(java.lang.String name, javax.xml.stream.XMLStreamReader reader)
           
 void onReceive(MessageContext context, InMessage msg)
           
 void setEndpointUri(java.lang.String endpointUri)
           
 void setTimeout(int timeout)
           
 void setTransport(Transport transport)
           
 void setUrl(java.lang.String url)
           
 void setXFire(XFire xfire)
           
 
Methods inherited from class org.codehaus.xfire.handler.AbstractHandlerSupport
addFaultHandler, addInHandler, addOutHandler, getFaultHandlers, getInHandlers, getOutHandlers, setFaultHandlers, setInHandlers, setOutHandlers
 
Methods inherited from class org.codehaus.xfire.AbstractContext
getProperty, removeProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIENT_MODE

public static final java.lang.String CLIENT_MODE
This is a variable set on the MessageContext to let particular Handlers know that the invocation is a client invocation.

See Also:
Constant Field Values
Constructor Detail

Client

protected Client()

Client

public Client(Transport t,
              Endpoint endpoint)
Creates a client for a particular Endpoint on a specified Transport. The client will create an anonymous Channel to talk to the service. The URI from the endpoint will be used as the destination for messages.

Parameters:
t - The Transport to use.
endpoint - The Endpoint to invoke.

Client

public Client(Binding binding,
              java.lang.String url)
Create a client which uses a particular Binding with a specified URL. The Transport is looked up via the TransportManager from its URL.

Parameters:
binding -
url -

Client

public Client(Transport t,
              Binding binding,
              java.lang.String url)
Create a client which uses a particular Binding with a specified URL and a specified Transport.

Parameters:
transport - The Transport to use.
binding -
url -

Client

public Client(Transport transport,
              Service service,
              java.lang.String url)
Create a Client on the specified Transport for a Service. The Client will look for an appropriate binding on the client bye attempting to find the first Binding that is compatabile with the specified Transport.

Parameters:
transport -
service -
url - The destination URL.

Client

public Client(Transport transport,
              Service service,
              java.lang.String url,
              java.lang.String endpointUri)
Create a Client on the specified Transport for a Service. The Client will look for an appropriate binding on the client bye attempting to find the first Binding that is compatabile with the specified Transport.

Parameters:
transport -
service - The Service model which defines our operations.
url - The destination URL.
endpointUri - The URI to bind to on the client side. The client will look for messages here.

Client

public Client(Binding binding,
              Transport transport,
              Service service,
              java.lang.String url,
              java.lang.String endpointUri)
Create a Client on the specified Transport for a Service. The Client will look for an appropriate binding on the client bye attempting to find the first Binding that is compatabile with the specified Transport.

Parameters:
binding - The Binding to use.
transport - The Transport to send message through.
service - The Service model which defines our operations.
url - The destination URL.
endpointUri - The URI to bind to on the client side. The client will look for messages here.

Client

public Client(javax.wsdl.Definition definition,
              java.lang.Class serviceClass)
       throws java.lang.Exception
Creates a Client form a WSDL and a service class. The Client will attempt to use the SOAP 1.1 HTTP binding.

Parameters:
definition - The WSDL definition.
serviceClass - The service class being used.
Throws:
java.lang.Exception

Client

public Client(java.lang.String binding,
              javax.wsdl.Definition definition,
              java.lang.Class serviceClass)
       throws java.lang.Exception
Creates a Client form a WSDL, a service class and the specified binding id.

Parameters:
definition - The WSDL definition.
serviceClass - The service class being used.
Throws:
java.lang.Exception

Client

public Client(java.io.InputStream is,
              java.lang.Class serviceClass)
       throws java.lang.Exception
Creates a Client form a WSDL and a service class.

Parameters:
is - The InputStream for the wsdl.
serviceClass - The service class being used.
Throws:
java.lang.Exception

Client

public Client(java.net.URL wsdlLocation)
       throws java.lang.Exception
Throws:
java.lang.Exception

Client

public Client(java.net.URL wsdlLocation,
              java.lang.Class serviceClass)
       throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

initFromDefinition

protected void initFromDefinition(java.lang.String binding,
                                  javax.wsdl.Definition definition,
                                  java.lang.Class serviceClass)
                           throws java.lang.Exception
Throws:
java.lang.Exception

findEndpoint

public Endpoint findEndpoint(java.lang.String binding,
                             java.util.Collection services)

invoke

public java.lang.Object[] invoke(OperationInfo op,
                                 java.lang.Object[] params)
                          throws java.lang.Exception
Throws:
java.lang.Exception

invoke

public java.lang.Object[] invoke(java.lang.String name,
                                 javax.xml.stream.XMLStreamReader reader)
                          throws java.lang.Exception
Throws:
java.lang.Exception

invoke

public java.lang.Object[] invoke(java.lang.String name,
                                 java.lang.Object[] params)
                          throws java.lang.Exception
Throws:
java.lang.Exception

onReceive

public void onReceive(MessageContext context,
                      InMessage msg)
Specified by:
onReceive in interface ChannelEndpoint

getOutChannel

public Channel getOutChannel()

close

public void close()

getTransport

public Transport getTransport()

setTransport

public void setTransport(Transport transport)

getService

public Service getService()

getUrl

public java.lang.String getUrl()

setUrl

public void setUrl(java.lang.String url)

getEndpointUri

public java.lang.String getEndpointUri()

setEndpointUri

public void setEndpointUri(java.lang.String endpointUri)

getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int timeout)

getXFire

public XFire getXFire()

setXFire

public void setXFire(XFire xfire)

getInstance

public static Client getInstance(java.lang.Object service)
Return the underlying Client instance for a client Proxy.

Parameters:
service -
Returns:
See Also:
XFireProxy, XFireProxyFactory


Copyright © 2004-2009. All Rights Reserved.