SOAP (Simple Object Access Protocol) send messages to a remote server with instructions to do something. For example you can have a class existing on one server with certain methods and routines.
Using SOAP (or XML Messaging) you can send an XML structure to make the remote class do something. For example the following XML (WSDL)structure describes the class on the remote server and displays what methods are available to this class:
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment" id="urn:ikeda-industries">
<isd :provider type="java" scope="Application" methods="addCompany getAllListings getCompany publishCompanies publishCompany putListings">
<isd:java class="org.ikeda.soap.CompanyListing"/>
</isd :provider>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
<isd:mappings>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:x="urn:ikeda-industries" qname="x:company" javaType="org.ikeda.soap.Company" java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer" xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
</isd:mappings>
</isd:service>
As you can see it defines a class called org.ikeda.soap.CompanyListing. This class allows people to access the methods: addCompany(), getAllListings(), getCompany(), publishCompanies(), publishCompany() and putListings().
You can invoke any of these methods from another class using the following technique:
CompanyListing cl = new CompanyListing();
Company company = new Company("Tone Inc",
"Anthony Ikeda",
"210 Copeland Road(East)",
"Beecroft",
"NSW",
"Australia");
cl.publishCompany("http://localhost:8100/soap/servlet/rpcrouter",company);
Here I'm using the class Company to construct a company (which is what a CompanyListing class is made up of) with cl.publishCompany() I'm sending the details to the soap server (
http://localhost:8100/soap/servlet/rpcrouter). These details are now readily available to whoever has similar classes (Company/CompanyListing).
The following example gets the data from the Soap Server:
...
System.out.println(cl.gatherAllCompanies("http://localhost:8100/soap/servlet/rpcrouter"));
It invokes the method on the server (gatherAllCompanies) which gets the data as an element, converts it to a string and returns the string (if you want it can be returned as an element only).
From my experience, SOAP is very "circular" in that the class you use to get the data work on themselves in another location so you are more or less constructing a class to return what it invokes (make sense?). This logic can be separated, but I keep it contained for the sake that I don't have too many classes everywhere.
Anyhow, check out xml.apache.org and look up SOAP for Java if your a Java user, else I'm sure
www.google.com will find the right SOAP implementation.
Cheers,
Anthony
[This message has been edited by Anthony Ikeda (edited August 27, 2001).]