Client UsageThe JiBX/WS client implementation uses a simple message exchange pattern. This is implemented in protocol
specific subclasses of the Client class. You specify the target service access location when
you create an instance of these classes, along with the JiBX binding factory for the bindings used by the web service,
and, optionally, with options specifying the encoding and format of the output. Once the instance has been created, you
use the // initialize SOAP client for service IBindingFactory fact = BindingDirectory.getFactory(Query.class); Client client = new SoapClient("http://localhost:8080/jibxws/quake", fact); ... // set up the query and pass in call to server Query query = new Query(); ... Response response = (Response)client.call(query); This accesses a service located at http://localhost:8080/jibxws/quake. Since JiBX/WS is
intended only for doc/lit web services, the operation to be performed by the service is always determined by the root
element of the request body. With JiBX/WS the request body is generated by marshalling out the object supplied to the
Client.call() method using the binding configured when
the The constructor takes a single binding factory parameter since it is expected that a single binding definition would define the bindings for all request and response objects, and for any SOAP Fault details objects. If this is not the case, the client includes separate methods for setting the binding factory for each of the request, response and SOAP body objects. The SoapClient also include options to set SOAP headers, add SOAP header handlers and set SOAP Fault handlers. Rather than specifying a concrete The default for output XML generated by the client is to use a UTF-8 text encoding without added spaces or line
breaks. You can alter these settings using the MessageOptions parameter to the The current main client limitation is the restriction to a simple generic Spring usageNo special support is currently included for using the Spring Framework on the client side. The JiBX/WS client can be configured using Spring, as shown in the Spring Hello World example. |