Web Services Interview Questions

This section covers frequently asked questions about web services and their underlying protocols.

29. Web Service Protocol Stack.

Web services use a layered protocol stack:

  1. Service Transport: Handles message transfer (HTTP, SMTP, FTP, BEEP).
  2. XML Messaging: Encodes messages in XML (XML-RPC, SOAP).
  3. Service Description: Describes the service (WSDL).
  4. Service Discovery: Locating services (UDDI).

30. Web Service Architecture.

Three key roles:

  • Service Provider: Creates and publishes the service.
  • Service Requestor (Consumer): Uses the service.
  • Service Registry: A directory for discovering services.

31. XML-RPC.

XML-RPC uses XML messages for remote procedure calls (RPCs).

32. BEEP (Block Extensible Exchange Protocol).

BEEP is an alternative to HTTP and FTP, supporting various application protocols.

33. Requirements for Accessing Web Services.

The client application needs to understand XML-based requests and responses. No special software is needed beyond a tool capable of handling HTTP requests and XML data.

34. UDDI's Language.

UDDI (Universal Description, Discovery, and Integration) uses WSDL (Web Services Description Language).

35. HTTP Methods in RESTful Web Services.

Method Action
GET Retrieve data
POST Create or update data
PUT Update a resource
DELETE Delete a resource
OPTIONS Get supported methods
HEAD Get headers only

36. Steps in Accessing a Web Service.

  1. Client creates a SOAP message.
  2. Message sent to the server (often using HTTP POST).
  3. Server processes the request.
  4. Server returns a SOAP response.
  5. Client processes the response.

37. SOAP Message Protocols.

SOAP isn't tied to a specific transport protocol; it can use various protocols (HTTP, SMTP, FTP, etc.) to transmit messages.

38. Platform Independence and Diverse Applications (XML-RPC).

XML-RPC's use of HTTP enables platform independence and supports diverse applications because HTTP is a widely used and understood protocol.

39. Role of Web Service Provider/Publisher.

The provider creates and publishes the web service, making it accessible to consumers.

40. Role of Web Service Requestor/Consumer.

The consumer uses the web service by sending requests and processing responses.

41. Example Web Service Provider (C#).

C# Code

// Code for a simple web service provider would be placed here.

42. Provider vs. Consumer.

The provider creates and hosts the service; the consumer uses it.

43. Additional WCF Contracts (Repeated from earlier).

(This section would reiterate the descriptions of Data Contracts, Fault Contracts, and Message Contracts.)