SOAP Interview Questions
In this post we will look at SOAP questions. Examples are provided with explanation.
Q: What is SOAP?
A: SOAP (originally Simple Object Access Protocol) is a protocol specification for exchanging structured information in the implementation of web services in computer networks. Its purpose is to induce extensibility, neutrality and independence. It uses XML Information Set for its message format, and relies on application layer protocols, most often Hypertext Transfer Protocol (HTTP) or Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission
Q:What is the Structure of the SOAP message?
A: The structure of a SOAP message. A SOAP message is encoded as an XML document, consisting of an <Envelope> element, which contains an optional <Header> element, and a mandatory <Body> element. The <Fault> element, contained in <Body> , is used for reporting errors.
Q: What is Top Down and Button Up approach development using SOAP ?
A: Top-down means you start with a WSDL and then create all the necessary scaffolding in Java all the way down. Bottom-up means you start with a Java method, and generate the WSDL from it.
Q: What is WSDL file ?
A: WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint.
Q: What are the advantages of SOAP over REST ?
In which scenario will you use SOAP instead of REST?
A: Contract first : SOAP defines standards to be strictly followed. We define a "contract-first" webservice using WSDL. In the contract-first web service, the "contract" i.e a WSDL definition of operations and endpoints and XML schema of the messages is created first, without actually writing any service code.REST does not define too much standards like SOAP.
WS-Security: While SOAP supports SSL (just like REST) it also supports WS-Security which adds some enterprise security features. WS-AtomicTransaction: Need ACID Transactions over a service, you’re going to need SOAP. WS-ReliableMessaging: If your application needs Asynchronous processing and a guaranteed level of reliability and security. Rest doesn’t have a standard messaging system and expects clients to deal with communication failures by retrying.
Q: How to develop SOAP webservice using Spring Boot ?
A: Spring Boot + SOAP Web Service Example Implement Spring Boot project to expose SOAP Web Service.
Q: How to develop SOAP webservice using Apache Camel ?
A: Apache Camel + Apache CXF SOAP Webservices