First make sure you have the appropriate import statements. The org.apache.soap package includes the classes representing the actual SOAP message like Body, Header, and Envelope. The org.apache.soap.rpc package includes classes used for the messaging interaction like Call, Parameter, and Response. The first thing you need to do is to create a new instance of the Call object. This object will be used to create and configure the message that is to be sent to the server.
Call is a subclass of org.apache.rpc.RPCMessage.
The receiving program needs to do the opposite by deserializing and decoding the message. A Vector is usually used to assemble the parameters. We construct a new Parameter by providing its name, its data type, its value, and an encoding style URI, which is null here. The url parameter refers to the unique url of the service. The SOAP call can either fail or succeed.