Sunteți pe pagina 1din 5

Best webservice Interview Questions

15 views
Question-1: what is webservice?

Answer:
Web Services are a general model for building applications and can be implemented for any
operation system that supports communication over the Internet. Web services take advantage of
the best of component-based development. Component-based object models like Distributed
Component Object Model (DCOM), Remote Method Invocation (RMI), and CORBAs Internet
Inter-ORB Protocol (IIOP) have been around for some time. Unfortunately, they depend on an
object modelspecific protocol. Web services extend these models by communicating with
Simple Object Access Protocol (
SOAP) and XML to eradicate the barrier posed by the object modelspecific protocol.
->How is the user (consumer) at Location A aware of the semantics of the Web service at
Location B? This question is answered by conforming to a common standard. Service
Description Language (SDL), SOAP Contract Language (SCL), and Network Accessible
Specification Language (NASSL) are some XML-like languages built for this purpose. Recently,
IBM and Microsoft came together and agreed on Web Service Description Language (
WSDL) as the Web service standard.

Question 2: Disadvantage of webservices?


Answer:there are following disadvantage:
1.Elaborate coding required at a low level of abstraction
2.Saturation of firewall port 80 (HTTP)
3.Lack of standard language mappings
4.Lack of standard services, e.g. events
5.Lack of performance due to the requirement to parse and transport XML
6.Lack of compile time type checking; harder debugging

7.stateless intraction

Question 3: Advantage of webservices?


Answer:
1.Exposing the existing function on to network
2.Connecting Different Applications ie Interoperability
3.Standardized Protocol
4.Low Cost of communication
5.Loosely coupled
6.ability to synchronous and asynchronous

Question 4: Why use webservices over other technologies?


Answer:
webservices use http protocol as others Java RMI and CORBA use optimized connectionoriented
communications protocols that are either
language specific, or have detailed rules defining
how data-structures and interfaces should be realized.

Question 5: Cases where webservices not better?


Answer:
1.Performence issue as use xml data .(more memory ,more proccessing time,more bandwidth)

2.Security issue as use http(http port open for each firewall so anything come with soap
message).

Question 6: what is REST?


Answer:REST defines a set of architectural principles by which you can design Web services that
focus on a systems resources, including how resource states are addressed and transferred over
HTTP by a wide range of clients written in different languages
Principles:
Use HTTP methods explicitly.
Be stateless.
Expose directory structure-like URIs.
Transfer XML, JavaScript Object Notation (JSON), or both.
Advantage of REST:
Lightweight not a lot of extra xml markup
Human Readable Results
Easy to build no tool-kits required
Question 7: SOAP Vs REST?
Answer:SOAP is better, ->REST reuses http security system, goes always over http, and try to
reuse the http methods making an equivalence between your semantic operation and http
methods (it is scandalous for me), it is not based upon message concepts. ->SOAP is good for
standards (that means good interoperability). You can use it over SMTP, JMS and HTTP. You
define your own operation with a name with meaning (AddCustomer vs HTTP POST in
URL/customer means add a customer). SOAP is based upon message concept, SOAP has its
own Security approach (WS-Security). SOAP messages can go through intermediate services
(for some logic o tecnical reason), and without re-encrypting the message. SOAP has efficiency

issues because of XML processing, But REST too!!! If you want efficiency and your application
is inside an intranet, then use EJB with RMI over IIOP!
Question 8: when should use RESTFUL webservice?
Answer:1.The web services are completely stateless. A good test is to consider whether the
interaction can survive a restart of the server.
2.If the data that the web service returns is not dynamically generated and can be cached
3.The service producer and service consumer have a mutual understanding of the context and
content being passed along. Because there is no formal way to describe the web services
interface, both parties must agree out of band on the schemas that describe the data being
exchanged and on ways to process it meaningfully. In the real world, most commercial
applications that expose services as RESTful implementations also distribute so-called valueadded toolkits that describe the interfaces to developers in popular programming languages.

A SOAP-based design may be appropriate when


A formal contract must be established to describe the interface that the web service offers. The
Web Services Description Language (WSDL) describes the details such as messages, operations,
bindings, and location of the web service.
The architecture must address complex nonfunctional requirements. Many web services
specifications address such requirements and establish a common vocabulary for them. Examples
include Transactions, Security, Addressing, Trust, Coordination, and so on. Most real-world
applications go beyond simple CRUD operations and require contextual information and
conversational state to be maintained. With the RESTful approach, developers must build this
plumbing into the application layer themselves.
The architecture needs to handle asynchronous processing and invocation. In such cases, the
infrastructure provided by standards such as
WSRM and APIs such as JAX-WS with their client-side asynchronous invocation support can be
leveraged out of the box.

Question 9: SOAP vs XML_RPC

Answer:
1.The biggest conceptual difference between SOAP and XML-RPC is that XML-RPC exchanges
a limited number of parameters of six fixed types, plus structs and arrays. However, SOAP
allows you to send the server arbitrary XML elements. This is a much more flexible approach.
2.In xml-rpc we only give parameter not name of parameter it consider only order but in soap we
give name also.

**SOAP limitations:
1.A SOAP message MUST NOT contain a Document Type Declaration
2.A SOAP message MUST NOT contain Processing Instructions.

SOAP vs REST:::
1. REST has no WSDL interface definition
2. REST is over HTTP, but SOAP can be over any transport protocols such HTTP, FTP, STMP,
JMS etc.
3. SOAP is using soap envelope, but REST is just XML.

S-ar putea să vă placă și