20 Soap Interview Questions and Answers

Dear Readers, Welcome to SOAP Interview questions with answers and explanation. These 20 solved SOAP questions will help you prepare for technical interviews and online selection tests conducted during campus placement for freshers and job interviews for professionals.

After reading these tricky SOAP questions, you can easily attempt the objective type and multiple choice type questions on this topic.

What are the steps taken in SOAP processing model?

SOAP stands for Simple object access protocol and it describes the distributed processing model. There are different nodes used and they are termed as SOAP nodes. These acts as a receiver of the processes and allows the access to the messages as well.

The nodes consists of the following process:

1. SOAP sender : It is a node that transmits the message received by the receiver.
2. SOAP receiver : It is a node that receives or accepts the message passed by the user.
3. SOAP message path : Is a node that sets the path to make it easy for the messages to go along and reach its destination.
4. Initial SOAP sender : Is also called as originator and it sends the message at the starting point of the message path and saves the settings there.
5. SOAP intermediary : It stays between the SOAP receiver and SOAP sender that contains the SOAP message. It processes the header blocks that forward the SOAP message to the receiver.
6. Ultimate SOAP receiver : Is the node where the message gets received finally. This is responsible for the processing of the contents used by the SOAP body and the SOAP header also included in it.

What is the message format used in SOAP?

The message format is written by using the XML language that writes the standard message format as it is widely used. It allows easy transition to deliver the SOAP based implementations. The format of the protocol allows easy readability, ease of error detection and it removes the problems with interoperability like the byte order.

The message that is been given is in the format given below:
POST /InStock HTTP/1.1
Host: localhost
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 299
SOAPAction: "http://www.abc.org/2003/05/soap-envelope"

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.abc.org/2003/05/soap-envelope">
<soap:Header>
</soap:Header>
<soap:Body>
<m:CareerName>Careeride</m:CareerName>
</soap:Body>
</soap:Envelope>

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 access techniques?

1. SOAP is simple to use and it is non-symetrical whereas DCOM or CORBA is highly popular and usually have complexity in them. It also has the symmetrical nature in it.
2. SOAP provides greater platform independent with the language independence whereas DCOM or CORBA doesn't provide any of these.
3. SOAP uses HTTP as its transport protocol and the data are being saved in XML format that can be ready by human, whereas DCOM or CORBA have their own binary formats that are used to transport the data in complicated manner.
SOAP identifies the object other than URL endpoint. SOAP objects are stateless and it is hard to maintain that. Whereas, it is not hard to maintain in case of other remote access techniques.

What is the procedure followed on the client side?

SOAP allows the right message to be passed and sent by the caller to the server need to be sent properly. The message should be appropriate and usually consists inside the SOAP envelope and it is being inserted in an optional Header and the body that is compulsory to be used. The message that is being written are encoded in XML format.

The SOAP program will show the code that allows the code is to be written.Like:
POST /StockPrice HTTP/1.1
Host: www.careerride.com
Content-Type: text/xml
Content-Length: nnnn

<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://www.careerride.com/career/ride/"
xmlns:xsi="http://www.abc.org/1999/XMLSchema/instance/"
xmlns:xsd="http://www.abc.org/1999/XMLSchema/"> //Envelope & Headers
<SOAP-ENV:Body>
<ns1:getAddressFromName xmlns:ns1="urn:AddressFetcher" SOAP-
ENV:encodingStyle="http://www.careerride.com/career/ride/">
<nameToLookup xsi:type="xsd:string">John B. Good</nameToLookup>
</ns1:getAddressFromName>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

How does building a call allows the communication to take place in between the client and the server using SOAP?

The process is quite simple when using SOAP to establish the communication between the client and server. The steps that are involved are:

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();
call.setTargetObjectURI("urn:test");
call.setMethodName("test");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
URL url = new URL
("http://localhost:8080/soap/ob.jsp");
Vector params = new Vector();
params.addElement(new Parameter("value", String.class, first, null));
call.setParams (params);

This program shows the building of the call class and then the target gets specified to the target method name. The target method name allows the server to know where to send the data. After setting this then the target object URI gets selected, it identifies the URL where the resource is located. The “NS_URI_SOAP_ENC” set the encoding style URL and allows it to add the parameter which is the new parameter value. This allows the data exchange between the client and the server. Building a call can be done using the SOAP API that provides lots of requests to be processed.

What is the procedure to send the call and get the response from the client to server using SOAP?

To get the response after sending the call the user need to invoke the URL of the router which routed the information and which consists the information of the server.

The following statement will set then invocation to get the response and set that in the database.
Response resp = call.invoke( url, "");
Parameter result = resp.getReturnValue ();
System.out.println (result.getValue ());

This allows the printing of the result in the standard output window. There will be used exception handling tag that will keep track of any error that might come in between while executing the statement and taking the response from the users.

How does the processing of the call() function happens on the server side using SOAP?

The call() on the server routes the message to the server that consists of a java object or any other object depending on the user language usage. This object waits for the method to get invoked. It can invoke any object doesn't matter local or remote as it will allow all the function to be invoked in the same way as others.

The calling of the function will be shown as:
class test
{
    private String result;
    public String test1(String a)
    {
        result = a + " testing of the invoking of object";
        return(result);
    }
}

the function returns the type String and it is the simplest type of SOAP. It tests the server that allow the call function to call the right resource method.

What are the steps involved in doing the data exchange between the client and the server?

The data that is exchanged between the client and server is in XML format and the SOAP passes the object between its methods and the object of the type parameter. SOAP deploys the service that is supplied in the Deployment management area and it is also an administrative tool. It keeps all the information about the services that are running on the web server. This is necessary to be done to keep the routing of the calls to identify the resource uniquely by using different parameters like different names and types. It is used to deploy the services for the client that sends the requests. Un-deploy or remove the services that are already deployed. Show the list of all the services that are deployed on the server and taking necessary actions on them.

What are the information contained in the service deployment model?

The service deployment information consists of all the services that are deployed on the server. It consists of the deploy function that can be used from a list of functions.

There are some properties that are used and provided with the services. It includes the following:

1. ID : It identifies the services uniquely that is being provided to the clients. It should be unique among the deployed services. It consists of a format that is urn:UniqueServiceID. It targets the object ID, and the specifications that has to be provided with it.
2. Scope : It defines the lifetime of an object that is serving the request coming from the client. This is having the specific format given as <jsp:useBean> tag. This also consists of properties like page: that the object is available or not to respond back to the request.
3. request : The request of the object and its availability to fulfill the request.
4. session : Allows the object to find the availability to get it for the complete session till the object is alive.

What does Method list of SOAP consists of?

The SOAP server will have important security implications and it has the scope that allows the security feature to be on the top. The method list has many other parameters as well:
It defines the name of the methods that are used when an object is invoked for the services. It provides the client a fast way to access the services. It includes the parameters as:

Provider type : That defines the name of the service and the user that has implemented or sent the request for the implementation. The class allows the target object to service the request and allow the use of static classes so that the scope can be found out.
Type mappings : Allow the control of the serialization and de-serialization of the specific types to be put in the form of XML in a particular style.

What does XML-SOAP server includes to allow flexible services for the users?

XML-SOAP includes the serialization classes that defines the type and the style using the Bean encoding class. It provides the generic serialization and different types of properties through which it will be easy to increate the support of XML encoding style. It provides a way to correct the serialization that is provided and maintains a registry of serializers and deserializers. The registry is provided and accessible by only the service administrator through the toold that is being provided by XML-SOAP. The services can be given by using the APIs that are in built and easy to use in the program. To register or derigester a service it always requires an interface that is being provided by the SOAP.

What are the steps that are required after providing the services to the clients?

The steps that are required after providing the services are:

1. When the service is deployed then all its information gets extracted and put in one place from where it can be easily accessed.
2. It is saved in a logical store and retrieved everytime the server is initiated.
3. The server like Apache uses JSP pages that calls the appropriate SOAP methods to perform retrieval work of the data that is being stored.
4. It uses the JSP to find the web applications under the directory of SOAP. It actually calls the Pluggable Configuration Manager that gets responsible for saving the current list of deployed services.
5. When the SOAP server restarts the services that were present before are not deployed again.
6. The use of function like undeploy() and deploy() is used on the created instance to manage the services and list() to manage the list of all the services that have been deployed on the server.

What are the functionalities provided by the SOAP protocol class?

The SOAP protocol is used to provide the simple access methods to all the applications that are present on the web. The functionalities that are provided by SOAP protocol is:

1. Call : Is the class that is used to provide the main functionality for a remote method that need to be called for. It is used to construct the call() and to set the encoding style of the registry that is mapped when it is required. This call() function is used by the RPC call that represents the options of the call object.
2. DeploymentDescriptor : This is the class that is used for deployment of the information about the SOAP services. This allows the deployment to take place in an easy way without the need of any other methods.
3. DOM2Writer : This is the class that is provided to serialize a DOM node as XML string and use it to provide more functionality.
4. RPCMessage : Is used as the base class that calls and respond to the request passed to the server.
5. ServiceManager : This is the class that deploys, lists and undeploy any SOAP services.

What are the web relation functionalities that is provided by SOAP protocol?

There are functionalities that is provided for the web page by the SOAP protocol and they are:

1. HTTPUtils : This provides the functionality of the POST method through which the request can be reached in a secure manner.
2. Parameter : It represents an argument to a RPC call that is used by both client and the server.
3. Response : response is an object that represents a RPC response by both client and server but the result will come after the method invocation only.
4. TCPTunnel : Is an object that provide the property of listening on a given port and forward all the host and port names.
5. TypeConverter : is a functionality provided to convert an object of one type to another type and this invoked with the class in the form object.

What are the problems faced by users by using SOAP?

SOAP is a new protocol that is used for cross-platform communication and it can bypass the firewall. This new protocol has more security vulnerabilities than any other. There is a problem to use this protocol as firewall is a security mechanism that comes in between. This block all the ports leaving few like HTTP port 80 and the HTTP port is used by SOAP that bypasses the firewall. It is a serious concern as it can pose difficulties for the users. There are ways like SOAP traffic can be filtered from the firewalls. Each SOAP header is having a unique header field that can be used to check the SOAP messages which are passing through the firewall.

How can user use the facilities that are provided by SOAP?

There are lots of facilities that are provided by SOAP protocol. The user can have some functions that can be used to get the facilities for it.

They are as follows:

1. PutAddress( ) : This is used to write or insert an address in the webpage. It sends address instance on the SOAP call.
2. PutListing( ) : This is used to allow the insertion of a complete XML document into the webpage. It takes XML file as an argument and passes the XML file to XML parser liason, which reads it and puts it as a parameter in the SOAP Call.
3. GetAddress( ) : This is used to define a query name and return the result that is best matched with the query. The name is sent to the SOAP call in the form of text string.
4. GetAllListing( ) : This is used to return the complete list in an XML format. There are no arguments that is sent when the method is call on the server.

How does SOAP work?

SOAP is used to provide a user interface that can be achieved from the client object and the request that it sends goes to the server that can be achieved by using the server object. The user interface creates some files or methods that consists of server object and the name of the interface to the server object. It also consists of other information like name of the interface and method. It uses HTTP to send the XML to the server using the POST method. The server parses the method and send the result to the client side. The server creates more XML that consists of responses of the user interface's request that is used using HTTP. Client can use any method of to send the XML. It can use the SMTP server as well as POP3 protocol to pass the messages and for request or respond queries.

How does the message security model allow the creation of SOAP more secure to use?

The security model consists of the security tokens that are given. These token consists of digital signatures to protect and authenticate the SOAP messages. Security tokens can be used to provide the binding between authentication secrets or keys and security identities. Security token uses the authentication protocols and an X.509 certificate to define the binding between the public key and identity key. The signatures are used to verify the messages and their origin by which the integrity can be found out. It is also used to produce the knowledge to confirm the security token to bind the person's identity to the sender's identity. Security model helps to prevent multiple security attacks and can be used to secure the SOAP architecture.

What are steps that are required to create a client side program that can interact with the SOAP?

The steps that are involved are:

1. The first step is to obtain an interface description that can be helpful to find out the SOAP service that are getting used.
2. Check for the registration of the serializers for all parameters that is required to be send and contain all the information that has to be received after successful deployment of the request.
3. Create an object using the following statement org.apache.soap.rpc.RPCMessage.Call.
4. In the call object set the appropriate target URI using the method setTargetObjectURI(// your parameters here).
5. In the call object set the method name that is required to invoke the object using setMethodName(//your parameters).
6. Create any necessary parameter objects for the RPC call and set the call object using the method given as setParams(// your code here).
7. Prepare the execution step to execute the call object's method invoke(// your parameter here)
8. Capture the Response object using the same method that is returned from the server invoke(// your parameters here).
9. Use the method generatedFault() to generate the fault if any during the processing.
10. Use the method to retrieve the fault if any, using getFault(// your parameters here) or else return back to the server.
What is SOAP? - SOAP
SOAP, Simple Object Access Protocol is a communication protocol, a way to structure data before transmitting it......
Examples where SOAP is used - SOAP
Remote methods over multiple platforms and technologies are used with HTTP. SOAP is XML based protocol and platform-agnostic.......
What are Transport methods in SOAP? - SOAP
Application layer and transport layers of a network are used by SOAP. SMTP and HTTP are the valid application layer protocol uses as transport for SOAP......
Post your comment