WebServices interview questions set 2/WebServices Interview Questions and Answers for Freshers & Experienced

Explain what is Push parsing and Pull parsing.

Pull Parsing: Streaming pull parsing is referred to a programming model in which a client application calls methods on an XML parsing library, when it needed to communicate with an XML infoset- which means the client will only gets XML data when it is asked for Push Parsing: In Push Parsing, the parser pushes parsing events or XML data to the application. In push model, the parser got the hold over the parsing process and the parser calls the implemented handler methods.

How are the terms "Platform independent" and "Diverse Application" are related to each other in the context of XML-RPC?

The terms "Platform independent" and "Diverse Application" were related to each other because XML-RPC uses HTTP for transporting SOAP messages over the web. The HTTP is a universal standard protocol for exchanging information on the Web. Hence, it leads to Cross Platform support/ Platform independent. So because it is Platform independent, it leads to the diverse application capable of accessing the web services.

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: http://docs.oracle.com/javase/6/docs/technotes/tools/share/wsgen.html

What the tool are required to test SOAP services?

SOAPUI tool for SOAP WS: http://www.soapui.org/

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: https://docs.oracle.com/javase/6/docs/technotes/tools/share/wsimport.html

How many Communication protocols can be used to implement a SOAP message? Is SOAP messages are tied to any protocol?

Communication protocol refers to the protocols which were used to transmit information over the web. By using Transport protocols, applications from the different background can quickly communicate with each other without knowing the inside functioning of the various systems. HTTP (Hyper-Text Transfer Protocol) can be used to implement a SOAP message whereas FTP (File Transfer Protocol) can be used as the reliable transport mechanism. SMTP and BEEP can also be used for transport mechanism.

What is the need of <Envelope> element in the SOAP document?

The element is used as the root element of every SOAP message.

The Root element is known as the first element in the XML Document.

The envelope, in turn, separated into two parts. One is the header part and second is the body part. The header contains the routing data which stores the source and destination address of the client. So the body includes the actual data.

What is a remote procedure call (RPC)?

The Remote procedure calls refer to the calls made to the methods which are hosted by related web service.

What are the points that should be considered by ports while binding?

WSDL allows extensibility elements that are used to specify binding information. Below are a few important points that should be kept into consideration while binding.

A port must not

<> Specify more than one address.
<> 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. The port element has the following two attributes

Name: This attribute provides the 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.

Explain <definition> element?

Definition element is described as the root of WSDL document which defines the name of the web service as well as act as a container for all the other elements.

Is binding between SOAP and WSDL possible?

Yes, it is possible to bind WSDL to SOAP. The binding is possible by basically two attributes:

Name: Defines the name of the binding.
Type: Defines the port for the binding.
For SOAP binding, two attributes need to be declared

Transport: Defines the SOAP protocol to be used i.e. HTTP.
Style: This attribute can be ‘rpc’ or ‘document’.

Enlist the operation types response used in WSDL?

WSDL basically defines 4 types of Operation type responses. These are enlisted below:

<> One-way: Receives a message but does not return the response.
<> Request-Response: Receives a request and return a response.
<> Solicit-Response: Sends a request and waits for a response.
<> Notification: Sends a message but does not wait for a response.

Explain the message element in WSDL?

The message element describes the data that has been exchanged between the consumer and the web service providers. Every web service consists of two messages and each message has zero or more <part> parameters. The two messages are:

>< Input: Describes the parameter for the web service.
>< Output: Describes the return data from the web service.

What are the different elements of WSDL documents?

The different elements of the WSDL document along with a brief description is enlisted below:

<> Types: This defines the message data types, which are in the form of XML schema, used by the web services.
<> Message: This defines the data elements for each operation where messages could be the entire document or an argument that is to be mapped.
<> Port Type: There are multiple services present in WSDL. Port type defines the collection of operations that can be performed for binding.
<> Binding: It determines and defines the protocol and data format for each port type.
<> Operations: This defines the operations performed for a message to process the message.

Explain WSDL?

WSDL stands for Web service Description Language. It is a simple XML document that comes under the Service Description layer of Web Service Protocol Stock and describes the technical details or locates the user interface to web service. Few of the important information present in WSDL document are

<> Method name
<> Port types
<> Service endpoint
<> Method parameters
<> Header information
<> Origin, etc

Whether do you find GraphQL the right fit for designing microservice architecture?

GraphQL and microservices are a perfect fit, because GraphQL hides the fact that you have a microservice architecture from the clients. From a backend perspective, you want to split everything into microservices, but from a frontend perspective, you would like all your data to come from a single API. Using GraphQL is the best way I know of that lets you do both. It lets you split up your backend into microservices, while still providing a single API to all your application, and allowing joins across data from different services.

What is the difference between encryption, encoding, and hashing?

Encryption, encoding and hashing are techniques used for converting the format of data.

<> Encryption is used for changing plain text into cipher text so that only authorized entities can understand it. Encryption deals with keys which are used to encrypt and decrypt the data. These keys are used to transform a simple text into a cypher text and the vice versa.

<> Encoding is used for changing the data into a special format which makes it usable by external processes. Unlike encryption, the intention of encoding is not related to security. The message is encoded by using an algorithm or scheme.

<> In hashing, the data is converted to a message digest or hash, which is usually a number generated from a string of text. Hashing is not reversible as encryption and encoding. The data is converted to a message digest or hash, which is usually a number generated from a string of text. These digests are important as one can easily match the hash of sent and received messages to ensure that both are the same and no tempering is done with the data.

What are main differences between Microservices and Monolithic Architecture?


Service Startup is fast
Microservices are loosely coupled architecture.
Changes done in a single data model does not affect other Microservices.
Microservices focuses on products, not projects

Monolithic Architecture

Service startup takes time
Monolithic architecture is mostly tightly coupled.
Any changes in the data model affect the entire database
Monolithic put emphasize over the whole project

Mention what is the difference between RPC or document style web services? How you determine to which one to choose?

In document style web services, we can transport an XML message as part of SOAP request which is not possible in RPC style web service. Document style web service is most appropriate in some application where XML message behaves as document and content of that document can alter and intention of web service does not rely on the content of XML message.

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

The security model includes the given security tokens. These tokens comprise digital signatures for protection and authentication of SOAP messages. Security tokens can be used to provide the bond between authentication secrets or keys and security identities. Security token uses the authentication protocols and an X.509 certificate to define the relationship between the public key and identity key. The signatures are used to verify the messages and their origin, generate knowledge to confirm the security tokens to bind the identity of a person to the identity of the originator. Security model prevents different attacks and can be used to protect the SOAP architecture.

What is Entrust Identification Service?

Entrust Identification Service is categorized under Entrust Secure Transaction Platform which provides essential security capabilities to ensure secure transactions. This usually allows companies to fully control the identities that are trusted to perform web service transactions.

What are the major functionalities provided by the SOAP protocol class?

The SOAP protocol is used to provide simple access methods for all the applications available on the Internet, providing the following functionalities:

Call: A class which provides the main functionality for a remote method for which a call is needed. It is used to create the call() and to specify the encoding style of the registry that will be assigned when if necessary. This call() function is used by the RPC call, which represents the options of the call object.
Deployment Descriptor: A class used to provide the information about the SOAP services. It enables easy deployment without the need for other approaches.
DOM2 Writer: A class that serializes and uses DOM node as XML string to provide more functionalities.
RPC Message: A class used as the base class that calls and replies to the request submitted to the server.
Service Manager: A class that provides, lists and then outputs all SOAP services.

What is the major obstacle users faced when using SOAP?

When using SOAP, users often see the firewall security mechanism as the biggest obstacle. This block all the ports leaving few like HTTP port 80 and the HTTP port used by SOAP that bypasses the firewall. The technical complaint against SOAP is that it mixes the specification for message transport with the specification for message structure.

What are the important characteristics of the SOAP envelope element?

We have seen the basic work of a SOAP envelope element in the previous answer, now let us see some of its characteristics:

> SOAP envelope is a packaging mechanism.
> 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 child.
> Prefix ENV and envelope element is used for specification.
> A namespace and an optional encoding style are used in case of optional SOAP encoding.

What are the elements of a SOAP message?

SOAP is just like other XML document and has the following elements:

<> Envelope: This element is defined as the mandatory root element. It translates the XML document and determines the start and end of the SOAP message.
<> Header: This element contains the optional header attributes of the message that contains specific information on the application. This element can occur multiple times and are intended to add new features and functionalities.
<> Body: This element is 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 the SOAP message.
<> Fault element: Errors that occur during the 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.

Explain the major obstacle faced by SOAP users?

One of the major hindrances observed by users of SOAP is the ‘Firewall security mechanism’. In this case, all the HTTP ports except those which bypass firewall is locked. In some cases, a technical issue of mixing specification of message transport with message structure is also observed.

Enlist the advantages and disadvantages of statelessness?

The advantages of statelessness include

<> Each and every method requests are treated independently.
<> Application design is simplified as it does not maintain the client’s previous interaction.
<> Works with HTTP protocol as it shares the feature of being statelessness.

What is a resource in RESTful web service and how it is represented?

Resource is said to be a fundamental concept having a type and relationship with other resources. In REST architecture, each content is considered as the resource and they are identified by their URIs.

Resources are represented with the help of XML, JSON, text, etc in RESTful architecture.

Explain what is JAXM messaging models?

There are two types of messaging models for JAXM synchronous and asynchronous

Synchronous messaging model: In such type of model, client directly communicates with the source. In this, the client will send the request and waits.

Asynchronous messaging model: In this model, client directs the message to the messaging provider and returns back. Messaging provider then executes the routing of the message to the end source.

Explain on which technology does XWS security is based on? List out the options that XWS security provides for securing JAX-RPC applications?

XWS security is based on securing web services build on JAX-RPC and on stand-alone application based on SAAJ. For securing JAX-RPC application, options that XWS security provides are

XML digital signature
XML encryption
Username token verification
XWS security framework APIs

Explain what is Stax?

Stax stands for Streaming API for XML; it is an API to read and write XML documents, originating from the JAVA programming language.

Explain what is Inline Customization?

Customization to JAXB bindings made by means of inline binding declarations in an XML schema file that take the form of <xsd:appinfo> elements embedded in schema <xsd:annotation>elements.

What is the caching mechanism?

Caching is just the practice of storing data in temporarily and retrieving data from a high-performance store (usually memory) either explicitly or implicitly.

When a caching mechanism is in place, it helps improve delivery speed by storing a copy of the asset you requested and later accessing the cached copy instead of the original.

What is the upper limit for a payload to pass in the POST method?

<GET> appends data to the service URL. But, its size shouldn’t exceed the maximum URL length. However, <POST> doesn’t have any such limit.

So, theoretically, a user can pass unlimited data as the payload to POST method. But, if we consider a real use case, then sending POST with large payload will consume more bandwidth. It’ll take more time and present performance challenges to your server. Hence, a user should take action accordingly.

Which purpose does the OPTIONS method serve for the RESTful Web services?

The OPTIONS Method lists down all the operations of a web service supports. It creates read-only requests to the server.

How often are the APIs changed and, more importantly, deprecated?

APIs, especially modern RESTful APIs, are a nice creation that can certainly simplify and accelerate integration efforts, which makes it more likely you will benefit from them. But APIs can and do change for various reasons, sometimes abruptly, and hence REST APIs do not differ from traditional integration methods in this respect. If an API call is obsolete and disappears, your procedure will interrupt and it is important to understand how often the APIs you depend on change or are deprecated.

Mention what are the three ways to handle the event encountered during the marshal, unmarshal and validate operations?

> Using the default event handler
> Register and Implement a custom event handler
> Use the ValidationEventCollector utility

Mention what are the types of validation can a JAXB client can perform?

There are two types of JAXB client validation that a JAXB can perform

1> Unmarshal Time Validation
2> On-Demand Validation

Explain what does Marshaller do if jaxb.encoding property is not declared?

By default, the Marshaller will use “UTF-8” if jaxb.encoding property is not declared.

Mention the JAXB binding framework?

JAXB binding framework is available in three Java Packages

>> xml.bind: This package defines abstract classes and interfaces that are used directly with content classes
>> xml.bind.util: This package contains utility classes that may be availed by client applications to manage marshalling, unmarshalling and validation events
>> xml.bind.helper: This helper package gives partial implementations for some of the javax.xml.bind interfaces. These APIs are not to be directly used by applications using JAXB architecture

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 annotation.

What is wsimport utility?

We can use wsimport utility to generate the client stubs. This utility comes with standard installation of JDK. Below image shows an example execution of this utility for one of JAX-WS project.

What is API documentation?

The API documentation is a complete, accurate technical writing giving instructions on how to effectively use and integrate with an API. It is a compact reference manual that has all the information needed to work with the API, and helps you answer all the API testing questions with details on functions, classes, return types, arguments, and also examples and tutorials.

Give me few reasons to use RESTful web service?

The RESTFul web services are simple to implement and test. It supports various data formats such as XML, JSON etc.

Can you name different kinds of web services?

There are two types of web services in total i.e. SOAP based web service and RESTful web service.

This question is already mentioned earlier.

Brief few drawbacks of using GET and POST methods to communicate with the web service?

These methods are less secure and inhibit users to pass structures and objects as arguments. Also, it doesn’t allow users to pass ByRef arguments.

Explain BEEP?

BEEP stands for Blocks Extensible Exchange Protocol. 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 features like

<> Authentication
<> Security
<> Error handling
<> Handshake Protocol

What are the steps performed by the client to access a web service?

First of all a web reference to the web service is created by the client in his application. Then a proxy class is generated. After that an object of the proxy class is created and at last, the web service is accessed via that proxy object.

Name the components to be published while deploying a Web Service?

The components that need to be published during a web service deployment are Web Application Directory, Webservice.asmx File, Webservice.Disco File, Web.Config File and Bin Directory.

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’s parameters. No type definitions are present in WSDL document.
Document style contains type and can be validated against predefined schema. Let’s look at these with a simple program. Below is a simple test program where I am using Endpoint to publish my simple SOAP web service.

R4R Team
R4R provides WebServices Freshers questions and answers (WebServices Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,WebServices interview questions set 2,WebServices Freshers & Experienced Interview Questions and Answers,WebServices Objetive choice questions and answers,WebServices Multiple choice questions and answers,WebServices objective, WebServices questions , WebServices answers,WebServices MCQs questions and answers Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for WebServices fresher interview questions ,WebServices Experienced interview questions,WebServices fresher interview questions and answers ,WebServices Experienced interview questions and answers,tricky WebServices queries for interview pdf,complex WebServices for practice with answers,WebServices for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .