File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes XML Messaging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML Messaging" Watch "XML Messaging" New topic

XML Messaging

L Goundalkar
Ranch Hand

Joined: Jul 05, 2001
Posts: 395
Hi all,
Can anyone explain me about XML Messaging.
Sun has provided the API known as JAXM1.0 in J2EE 1.3 which states that this API enables applications to send and receive document oriented XML messages using a pure Java API. JAXM implements Simple Object Access Protocol (SOAP) 1.1 with Attachments messaging so that developers can focus on building, sending, receiving, and decomposing messages for their applications instead of programming low level XML communications routines.
Can you explain this?

L Goundalkar
Sun Certified Programmer for Java 2 Platform

Anthony Ikeda

Joined: Jan 23, 2001
Posts: 6
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="" 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:map encodingStyle="" 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"/>
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)",
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:
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 and look up SOAP for Java if your a Java user, else I'm sure will find the right SOAP implementation.
[This message has been edited by Anthony Ikeda (edited August 27, 2001).]
L Goundalkar
Ranch Hand

Joined: Jul 05, 2001
Posts: 395
Can you give me some reference sites so that I can learn about this topic in detail.

L Goundalkar
Sun Certified Programmer for Java 2 Platform
Kris Decker
Ranch Hand

Joined: Jul 25, 2001
Posts: 38
check this thread
Originally posted by L Goundalkar:
Can you give me some reference sites so that I can learn about this topic in detail.

I agree. Here's the link:
subject: XML Messaging
jQuery in Action, 3rd edition