NonStop SOAP for Java User's Manual

NonStop SOAP for Java User’s Manual523860-001
6-1
6 Using the SOAP Client APIs
This section discusses the SOAP client-side APIs for Java and how attachments are
implemented on the client and server.
Client APIs
Apache SOAP provides a client-side API to assist in the construction of the SOAP
request, and the interpretation of the response. To invoke a procedure, you need the
name of the procedure and the parameters to pass to it. When the invocation
completes, you need to extract any response information from the return value and/or
output parameters. The Apache SOAP API documentation is located in the following
directory:
<soap installation loc>/docs/index.html
The API documentation can also be located at http://ip-
addr:port/servlet_jsp/soap/docs/index.html.
To create a client that interacts with a SOAP RPC-based service, do the following:
1. Obtain the interface description of the SOAP service, so that you know what the
signatures of the methods that you wish to invoke are.
You can either look at a WSDL file (or at some other interface definition format) for
the service, or directly at its implementation.
2. Make sure that there are serializers registered for all parameters which you will be
sending, and deserializers for all information which you will be receiving back.
Parameters must be serialized into or deserialized from XML before they can be
transmitted or received. Therefore, Apache SOAP provides a number of pre-
defined serializers and deserializers. If you need to transmit or receive a type
which has not been registered, you must write and register your own serializer and
deserializer.
3. Create the org.apache.soap.rpc.RPCMessage.Call object.
The Apache SOAP Call object is the main interface to the underlying SOAP RPC
code
4. Set the target URI into the Call object using the setTargetObjectURI(...) method.
Pass in the URN that the service used to identify itself in its deployment descriptor.
5. Set the method name that you wish to invoke into the Call object using the
setMethodName(...) method.
Note. The NonStop SOAP for Java client-side APIs product and documentation is based on
the Apache SOAP version 2.2 specification. The Apache SOAP User’s Guide is available at
http://xml.apache.org/SOAP/docs/guide/intro.html.