Easy learning with example program codes

Java soap web services tutorial

SOAP web services:

SOAP stands for Simple Object Access Protocol. It is used to transfer the data. It is a XML-based messaging-layer protocol. SOAP can be used in combination with a variety of transport protocols like HTTP, SMTP, and JMS etc.

Note: SOAP is part of the set of standards specified by the W3C.

SOAP message structure:

Envelope: It is a mandatory element and used to define the start and the end of the message.
Header: It is an optional element which provides the information on authentication, encoding of data, or how a recipient of a SOAP message should process the message.
Body: It is a mandatory element and contains the XML data comprising the message being sent.
Fault: It is an optional element which provides information about errors that occur while processing the message.



1. Using SOAP over HTTP allows for easier communication through proxies and firewalls than previous remote execution technology.
2. SOAP is versatile enough to allow for the use of different transport protocols. The standard stacks use HTTP as a transport protocol, but other protocols are also usable e.g. SMTP and JMS.
3. SOAP is platform independent.
4. SOAP is language independent.


1. Because of the verbose XML format, SOAP can be considerably slower than competing middleware technologies such as CORBA.
2. When relying on HTTP as a transport protocol and not using WS-Addressing or an ESB, the roles of the interacting parties are fixed. Only one party (the client) can use the services of the other. Developers must use polling instead of notification in these common cases.
3. Although SOAP is an open standard, not all languages offer appropriate support. Java, Curl, Delphi, PHP, .NET and Flex offer excellent SOAP integration and/or IDE support. Some Perl and Python support exists.
4. SOAP clients do not hold any stateful references to remote objects.

Copyright © 2018 CodesJava Protection Status SiteMap