SOAP Web service Interview Question
- Define SOAP? SOAP stands for Simple Object
Access Protocol. SOAP is an XML based industry standard protocol for
designing and developing web services. It is platform and language
independent. So our server can be based on JAVA and client can be on
.NET, PHP etc. and vice versa.
- What are advantages of SOAP Web Services?
- WSDL document provides contract and technical details of the web
services for client applications without exposing the underlying
- SOAP uses XML data for payload as well as contract, so it can be
easily read by any technology.
- SOAP protocol is universally accepted, so it is an industry
standard approach with many easily available open source
- It is very simple as well as uses standard HTTP protocol and XML
for sending and receiving messages.
- It defines and uses its own security known as WS security.
- It allows circulation of messages in distributed and
- What are disadvantages of SOAP Web Services?
- SOAP is slow because payload is large for a simple string
message, since it uses XML format.
- There is a tight coupling between client and server
- Anytime there is change in the server side contract, client stub
classes need to be generated again.
- Security facilities are not present.
- Only XML can be used, JSON and other lightweight formats are not
- Can not be tested easily in browser
- What is WSDL? WSDL stands for Web Service
Description Language. WSDL is an XML based document that provides
technical details about the web service. Some of the useful
information in WSDL document are: method name, port types, service
end point, binding, method parameters etc.
- What are different components of WSDL?
- xsd:import namespace and schemaLocation: provides WSDL URL and
unique namespace for web service.
- message: for method arguments
- part: for method argument name and type
- portType: service name, there can be multiple services in a wsdl
- operation: contains method name
- soap:address for endpoint URL.
- What is the information present in WSDL document
- Method name
- Port types
- Service end point
- Method parameters
- Header information
- Origin, etc
- What is UDDI? UDDI is acronym for Universal
Description, Discovery and Integration. UDDI is a directory of web
services where client applications can lookup for web services. Web
Services can register to the UDDI server and make them available to
- Which language is used by UDDI? WSDL (Web
Service Description Language)
- What is UDDI features?
- It is an open framework and is platform independent.
- SOAP, COBRA, and Java RMI protocols are used for communication.
- It helps businesses to discover each other and enable
interaction between them over the internet.
- It acts as a database containing all WSDL files.
- Explain Blocks Extensible Exchange Protocol (BEEP)?
BEEP is determined as building new protocols for the variety of
applications such as instant messaging, network management, file
transfer etc. It is termed as new Internet Engineering Task Force
(IETF) which is layered directly over TCP. It has some built-in
- Error handling
- Handshake Protocol
- What is difference between Top Down and Bottom Up
approach in SOAP Web Services?
Top Down approach - first WSDL document is created
to establish the contract between web service and client and then
code is written. This is hard to implement because classes need to be
written to confirm the contract established in WSDL.
Benefit of this approach is that both client and server code
can be written in parallel.
Bottom Up approach - First web service code is
written and then WSDL is generated. This approach is easy to
implement because WSDL is generated based on code.
In this approach client code have to wait for WSDL from
server side to start their work.
- Do we require any special application to access web
The only requirement for accessing web services from any
application is that it
must support XML-based request and response. There
is no need of installing any application for accessing web services.
- What are the tools used to test SOAP web services?
- REST client
- Apache JMeter
- What is JAX-WS API? JAX-WS stands for Java API
for XML Web Services. JAX-WS is XML based Java API to build web
services server and client application. It is part of standard Java
API, so we do not need to include anything else which working with
- Name important annotations used in JAX-WS API?
@WebService, @SOAPBinding, @WebMethod
- What is use of javax.xml.ws.Endpoint class?
Endpoint class provides useful methods to create endpoint and publish
existing implementation as web service.
- What is the difference between RPC Style and Document
Style SOAP web Services? RPC style generate WSDL document based
on the method name and it is parameters. No type definitions are
present in WSDL document.
Document style contains type and can be validated against
- How to get WSDL file of a SOAP web service? WSDL
document can be accessed by appending wsdl to the SOAP endoint URL.
example -- http://javarefresh:9999/testWS?wsdl
- What is sun-jaxws.xml file? File provides
endpoints name, implementation class and URL pattern details when
JAX-WS web services are deployed in servlet container such as Tomcat.
File present in WEB-INF directory.
- What is wsimport utility? wsimport utility to
generate the client stubs. Utility comes with standard installation
- What is the use of @XmlRootElement annotation?
XmlRootElement annotation is used by JAXB to transform java object to
XML and vice versa. So we have to annotate model classes with this
- Explain the major hindrance faced by SOAP users?
One of the major hindrance of SOAP is the "Firewall security
mechanism". In this case, all the HTTP ports except those which
bypass firewall are locked. In some cases, a technical issue of
mixing specification of message transport with message structure is
- What are the elements of a SOAP message?
- Envelope: Mandatory root element. It translates
the XML document and determines the start and end of the SOAP
- Header: Optional header attributes of the
message that contains specific information of the application. This
element can occur multiple times and are intended to add new
features and functionalities.
- Body: Mandatory and contains the call and
response messages. It is also defined as the child element of the
envelope containing all the application derived XML data that has
been exchanged as a part of SOAP message.
- Fault element: Errors that occur during
processing of the messages are handled by the fault element. If the
error is present, then this element appears as a child element of
the body. However, there can only be one fault block.
- What are the important characteristics of SOAP
- Every Soap message has a mandatory root envelope message.
- Only one body element is allowed for each envelope element.
- As the SOAP version changes, envelope changes.
- If the header element is present, it should appear as the first
- Prefix ENV and envelope element is used for specification.
- A namespace and an optional encoding style are used in case of
optional SOAP encoding.
- SOAP envelope is a packaging mechanism.
- What are rules applicable for SOAP message?
- Must be encoded using XML.
- Must use the SOAP envelope namespace.
- Must use the SOAP encoding namespace.
- Must not contain the DTD reference.
- Must not contain XML processing instructions.
- What are the operation types response used in WSDL?
Among these, Request-Response is the most common operation
- One-way: Receives a message but does not return
- Request-Response: Receives a request and return
- Solicit-Response: Sends a request and wait for
- Notification: Sends a message but does not wait
for a response.
- Is binding between SOAP and WSDL possible?
Yes, it is possible to bind WSDL to SOAP. The
binding is possible by basically two attributes
For SOAP binding, two attributes need to be declared
- Name: Defines the name of the binding.
- Type: Defines the port for the binding.
- Transport: Defines the SOAP protocol to be used
- Style: This attribute can be rpc or document.
- What are the points that should be considered by
ports while binding? WSDL allows extensibility elements which
are used to specify binding information. A port must not
- Name: Specify more than one address.
- Type: Specify any binding information other
than address information.
- What are the two attributes of <Port> element
in WSDL? Every port element is related to a specific binding by
defining an individual endpoint.
- Name: unique name within the WSDL document.
- Binding: This attribute refers to the process
of binding which has to be performed as per the linking rules
defined by WSDL.
- what is the difference between JSON and SOAP?
JSON is standard to represent human readable data. SOAP is a protocol
requirement for transmitting information and calling web-services
- what is the transport method in SOAP?
Application and transport layers of a network are used by SOAP. HTTP
and SMTP are the valid application layer protocol used as transport
for SOAP. HTTP is more preferable as it works well with current
internet infrastructure especially with firewalls.
The SOAP requests can be sent via an HTTP GET method while the
specification includes details on HTTP POST only.
- what is the end point in web services? IP
address of the server where the web services are running is the end
point in web services.
- How SOAP is different from traditional RPC? SOAP
used procedures which has named parameters and order is irrelevant
Where as in XML-RPC order is relevant and parameters do not have
- How is HTTPS used in SOAP? HTTPS is similar to
HTTP but it has an additional layer underneath the internet
application layer which makes the data encrypted. This protocol is
widely used than IOP or DCOM because those protocols are filtered by
firewalls. HTTPS protocol advocates WS-I method to provide security
for transmission of secured data.
- What is the use of having SOAP messages with
attachments? SOAP messages can be attached with MIME extensions
that come in multipart/related. It is used to send messages using the
binary data with certain defined rules that are applied on it. The
SOAP message is carried in the body part with the structure that is
followed by the message of the SOAP. The MIME extension when used
with SOAP consists of a content-id that uniquely identifes the
content that is being used and the location of it. There are many
ways through which the extension of the SOAP capabilities can be
applied to the new applications. SOAP messages are used with the
attachments to make it more portable and user friendly. The MIME type
can be a audio or video or any other media related type that is
associated with a web page.
- what is the difference between SOAP and other remote
SOAP web service
Other Remote access
|It is user-friendly, and it is non-symmetrical
||whereas DCOM or CORBA is highly popular and usually have
complexity in them. Symmetrical in nature
|SOAP provides greater platform independent with the language
||DCOM or CORBA doesn't provide any of these
|saved in XML format.
||own binary formats
|SOAP objects are stateless and it is hard to maintain.
||DCOM or CORBA can maintain the state
|SOAP provides greater platform independent with the language
||DCOM or CORBA doesn't provide any of these
- How does building a call allows the communication to
take place in between the client and the server using SOAP?
Make a call to the client side to send the request for the data
access and it will be made like this:
Call call = new Call();
URL url = new URL
Vector params = new Vector();
params.addElement(new Parameter("value", String.class, first, null));
What is the procedure to send the call and get the
response from the client to server using SOAP?
Response resp = call.invoke( url, "");
Parameter result = resp.getReturnValue ();
System.out.println (result.getValue ());
What is MTOM
MTOM (Message Transmission
Optimization Mechanism) is a mechanism for transmitting large binary
attachments with SOAP messages as raw bytes, allowing for smaller
What is XOP?
XOP (XML-binary Optimized
Packaging) is a mechanism defined for the serializationof XML
Information Sets that contain binary data, as well as deserialization
back into the XML Information Set.
What is a SOAP envelope element?
element is the root element of a SOAP message which defines the XML
document as a SOAP message.
What is the wsimport tool?
The wsimport tool is
used to parse an existing Web Services Description Language (WSDL)
file and generate required files (JAX-WS portable artifacts) for web
service client to access the published web services More info
What is the wsgen tool?
The wsgen tool is used
to parse an existing web service implementation class and generates
required files (JAX-WS portable artifacts) for web service
deployment. More details