Saturday, 26 May 2012

Web Service Interview Questions


SOAP, Simple Object Access Protocol is a communication protocol, a way to structure data before transmitting it, is based on XML standard................... 
Read answer
Simple Object Access Protocol is a XML based protocol that enables application to communicate with each other. SOAP has a standard format for sending messages.................
Read answer
Different application running on different types of operating systems and using different technologies..............
Read answer
HTTP – The most common and preferred method of transport. HTTP is simple and universally accepted. The mechanism for sending a SOAP message over HTTP...............
Read answer
XML is used as a message format to communicate. Due to the open source nature of XML,...............
Read answer
Envelope – Translates the XML document to a SOAP message. It is the root element..................
Read answer
SOAP envelope element is the root element used to define the XML document as a SOAP message..................
Read answer
The header element may pass through different endpoints before it reaches the receiver. SOAP actor element is specifically used to address the header element to a specific endpoint...................
Read answer
SOAP body element is used to enclose the actual message. It is a required element that is enclosed within the Envelope tag...............
Read answer
A SOAP message has no default encoding. Hence, in order to define data types used in the document encodingStyle attribute is used. It can appear in any SOAP element..............
Read answer
The main purpose of SOAP is to exchange messages over HTTP. For communication it uses XML. The messages exchanged if done in plain text can be potentially viewed by...............
Read answer
Also read
Explain each web service technologies - SOAP, WSDL, UDDI, eBXML and JAX pack. Explain the technologies included within JAX pack, i.e. JAXP, JAXB, JAXM, JAX-RPC, JAXR..........
What is XML Web Server? | Describe the Components that help locate and consume XML Web Service. | Describe the process of communication between Client and Web Service. | What are the components published while deploying of Web Service? | Describe .disco file. | Describe the step to be followed to access web service by client..........
What is .Net Web Service? What is SOAP? What is WSDL? What is UDDI? Why do we need Web Services? Explain in brief different distributed technologies. Web services vs. CORBA and DCOM. Advantages of Web Services.................
Define Exception handling in ASP.NET. | What are the ways of handling exceptions in ASP.NET? | Explain Try/catch block method of exception handling. | Define Error Events. Define Custom Error Pages. | Why is exception handling important to an application? | When can you use tracing with exception handling?
What is Master Page in ASP.NET? | Advantages of using Master Page in ASP.NET | Define Multiple Master Page. | How do you create Master Page?
Answer - Web services exposes functionality over internet using protocol such as.....
Answer - UDDI, Universal description, discovery and integration.....
Answer - Following are the steps to get a proxy object of a web service at the client side......
Explain about Serialization in .NET. Explain binary serialization and XML serialization.
What is Formatters? Explain the binary formatter and the SOAP formatter.
Explain why Serialization.
Explain the components that comprise the binary serialization architecture......
Here, we will be exploring the Service Engine. Services in OFBiz operate in a Service Oriented Architecture (SOA). These services not only have the ability to invoke other services internaBlly, but can also be 'opened up' and invoked by remote applications using, amongst other methods, the widely adopted messaging protocol SOAP.


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 are 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:
SOAP sender: it is a node that transmits the message received by the receiver.
SOAP receiver: it is a node that receives or accepts the message passed by the user. 
SOAP message path: is a node that sets the path to make it easy for the messages to go along and reach its destination. 
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. 
SOAP intermediary: is a in 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. 
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.w3.org/2003/05/soap-envelope"

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.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?

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. 
SOAP provides greater platform independent with the language independence whereas DCOM or CORBA doesn't provide any of these. 
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 indefiy 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.w3.org/1999/XMLSchema/instance/"
xmlns:xsd="http://www.w3.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:
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. 
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.
request: the request of the object and its availability to fulfill the request. 
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:
When the service is deployed then all its information gets extracted and put in one place from where it can be easily accessed.
It is saved in a logical store and retrieved everytime the server is initiated. 
The server like Apache uses JSP pages that calls the appropriate SOAP methods to perform retrieval work of the data that is being stored. 
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.
When the SOAP server restarts the services that were present before are not deployed again. 
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. 
Q14. 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: 
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. 
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. 
DOM2Writer: this is the class that is provided to serialize a DOM node as XML string and use it to provide more functionality. 
RPCMessage: is used as the base class that calls and respond to the request passed to the server. 
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:
HTTPUtils: this provides the functionality of the POST method through which the request can be reached in a secure manner. 
Parameter: it represents an argument to a RPC call that is used by both client and the server.
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.
TCPTunnel: is an object that provide the property of listening on a given port and forward all the host and port names.
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:
PutAddress( ): this is used to write or insert an address in the webpage. It sends address instance on the SOAP call. 
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.
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.
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).
8. use the method generatedFault() to generate the fault if any during the processing.
9. use the method to retrieve the fault if any, using getFault(// your parameters here) or else return back to the server.


No comments:

Post a Comment

Write your openion about my blog spot..To get automatic facebook updates like my Pagehttps://www.facebook.com/shivashankar4u ..It takes only 1 min to write the comment and to like the page.. Thanks.