Webservice Interview Questionsx

balecomputerΑσφάλεια

3 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

121 εμφανίσεις

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

CORBA’s

Internet

Inter
-
ORB

Protocol

(IIOP)

have

been

around

for

some

time.

Unfortun
ately,

they

depend

on

an

object

model

specific

protocol.

Web

services

extend

these

models

by

communicating

with

Simple

Object

Access

Protocol

(

SOAP
)

and

XML

to

eradicate

the

barrier

posed

by

the

object

model

spec
ific

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
-
lik
e

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 requir
ement 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 us
e 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 system’s 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, SOA
P 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 e
fficiency 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 rest
art 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 w
ay 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 imp
lementations also distribute so
-
called value
-
added 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
specificatio
ns 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 a
nd
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 provi
ded 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 s
end 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.