org.jibx.ws.client
Class Client

java.lang.Object
  extended by org.jibx.ws.client.Client
Direct Known Subclasses:
PoxClient, SoapClient

public abstract class Client
extends Object

A generic client for connecting to services. Provides common methods that are not protocol specific. For access to protocol specific features, such as SOAP headers, refer to the protocol specific subclass (for example, SoapClient).


Method Summary
abstract  Object call(Object request)
          Send a request to the service and wait for the response to be returned.
 void close()
          Free resources and end client usage.
 void setBindingFactory(IBindingFactory factory)
          Sets a single JiBX binding factory to be used for for marshalling and unmarshalling the body elements.
 void setInBodyBindingFactory(IBindingFactory factory)
          Sets the JiBX binding factory for the inbound body.
 void setMessageOptions(MessageOptions options)
          Sets options for the encoding, XML declaration and formatting of the outbound message.
 void setOutBodyBindingFactory(IBindingFactory factory)
          Sets the JiBX binding factory for the outbound body.
 void setTransportOptions(org.jibx.ws.transport.TransportOptions transportOptions)
          Sets options for configuring the transport.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setBindingFactory

public void setBindingFactory(IBindingFactory factory)
                       throws WsBindingException
Sets a single JiBX binding factory to be used for for marshalling and unmarshalling the body elements. This binding factory should include bindings for any elements that are to be contained in the outbound or inbound SOAP body.

For finer grain control of the different elements use setOutBodyBindingFactory(IBindingFactory) and setInBodyBindingFactory(IBindingFactory).

Parameters:
factory - the binding factory to use for outbound and/or inbound SOAP bodies, and/or SOAP fault details
Throws:
WsBindingException - if marshaller cannot be created due to an error with the JiBX bindings

setOutBodyBindingFactory

public final void setOutBodyBindingFactory(IBindingFactory factory)
                                    throws WsBindingException
Sets the JiBX binding factory for the outbound body.

Parameters:
factory - the JiBX binding factory to use for writing the outbound body
Throws:
WsBindingException - if marshaller cannot be created due to an error with the JiBX bindings

setMessageOptions

public final void setMessageOptions(MessageOptions options)
Sets options for the encoding, XML declaration and formatting of the outbound message.

Parameters:
options - specifies the options for the outbound message

setTransportOptions

public void setTransportOptions(org.jibx.ws.transport.TransportOptions transportOptions)
Sets options for configuring the transport.

Parameters:
transportOptions - options

setInBodyBindingFactory

public final void setInBodyBindingFactory(IBindingFactory factory)
                                   throws WsBindingException
Sets the JiBX binding factory for the inbound body.

Parameters:
factory - the JiBX binding factory to use for reading the inbound body
Throws:
WsBindingException - if unmarshaller cannot be created due to an error with the JiBX bindings

call

public abstract Object call(Object request)
                     throws IOException,
                            WsException
Send a request to the service and wait for the response to be returned.

Parameters:
request - object to be marshalled to XML as body of request (may be null, for an empty request body)
Returns:
response object unmarshalled from body of response (may be null, for an empty response body)
Throws:
IOException - on error in communicating with service
WsException - on error in request processing, or a WsConfigurationException if either:
  • request is non null and a binding factory or handler has not been set for the outbound body, or
  • the response contains a non-empty body and a binding factory or handler has not been set for the inbound body.

close

public final void close()
                 throws IOException
Free resources and end client usage.

Throws:
IOException - on error closing channel


Project Web Site