SOAP tutorial....Part 1

Posted by Shashank Krishna Monday, July 27, 2009


sharethis:
At the heart of Web services today are SOAP and WSDL, so it’s important that
you have a good understanding of them and how they’re used. That said, memorizing the details of SOAP and WSDL is not critical. While these technologies are central to Web services, in many cases you may not deal with them directly, as they will be hidden in the communication and deployment layer of the J2EE Web Services platform.



SOAP
SOAP was originally an acronym for Simple Object Access Protocol. (Now it’s just a name.) SOAP 1.1 is the standard messaging protocol used by J2EE Web Services, and is the de facto standard for Web services in general. SOAP’s primary application is Application-to-Application (A2A) communication. Specifically, it’s used in Business- to-Business (B2B) and Enterprise Application Integration (EAI).

Despite all the hoopla, however, SOAP is just another XML markup language
accompanied by rules that dictate its use. SOAP has a clear purpose: exchanging
data over networks. Specifically, it concerns itself with encapsulating and encoding
XML data and defining the rules for transmitting and receiving that data. In a
nutshell, SOAP is a network application protocol.

A SOAP XML document instance, which is called a SOAP message,1 is usually
carried as the payload of some other network protocol. For example, the most
common way to exchange SOAP messages is via HTTP (HyperText Transfer Protocol),
used by Web browsers to access HTML Web pages. The big difference is that
you don’t view SOAP messages with a browser as you do HTML. SOAP messages
are exchanged between applications on a network and are not meant for human
consumption. HTTP is just a convenient way of sending and receiving SOAP
messages.


The Basic Structure of SOAP

As you now know, a SOAP message is a kind of XML document. SOAP has its own
XML schema, namespaces, and processing rules. This section focuses on the structure
of SOAP messages and the rules for creating and processing them.

A SOAP Message That Contains an Instance of Purchase Order Markup






Amazon.com
923

AMAZON.COM
1850 Mercer Drive
Lexington
KY
40511


J2EE Web Services
300
24.99






This message is an example of a SOAP message that contains an arbitrary XML
element, the purchaseOrder element. In this case, the SOAP message will be One-
Way; it will be sent from the initial sender to the ultimate receiver with no expecta-
tion of a reply. Monson-Haefel Books’ retail customers will use this SOAP message
to submit a purchase order, a request for a shipment of books. In this example,
Amazon.com is ordering 300 copies of this book for sale on its Web site.


The Structure of a SOAP Message













SOAP Namespaces

XML namespaces play an important role in SOAP messages. A SOAP message may
include several different XML elements in the Header and Body elements, and to
avoid name collisions each of these elements should be identified by a unique name-
space. For example, a SOAP message that contains the purchaseOrder element as
well as message-id and XML digital-signature header blocks would include no
fewer than six different namespaces





11d1def534ea:b1c5fa:f3bfb4dcd7:-8000











Spread Firefox Affiliate Button | edit post .

0 comments

Post a Comment

Are You Planning on Quitting Facebook? Why?

@Flickr

www.flickr.com

About Me

My Photo
Shashank Krishna
Bangalore, up, India
nothin much to say.........doin B.tech in IIIT allahabad loves bloggingn hacking.... :) and loooves blogging
View my complete profile

ads2

topads