Soap UI API Interview Question

 1- Difference between soap and rest API:

  • SOAP stands for Simple Object Access Protocol##REST stand for Representational State Transfer.
  • SOAP is a protocol. SOAP was designed with a specification. It includes a WSDL file that has the required information on what the web service does in addition to the location of the web service##REST is an Architectural style in which a web service can only be treated as a RESTful service if it follows the constraints of being
    1. Client Server
    2. Stateless
    3. Cacheable
    4. Layered System
    5. Uniform Interface
  • SOAP cannot make use of REST since SOAP is a protocol and REST is an architectural pattern.##REST can make use of SOAP as the underlying protocol for web services, because in the end it is just an architectural pattern.
  • SOAP can only work with XML format. As seen from SOAP messages, all data passed is in XML format.##REST permits different data format such as Plain text, HTML, XML, JSON, etc. But the most preferred format for transferring data is JSON.
2-SOAP Response Messages(Link: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
Search in google: HTTP response status codes


Success Codes

  • 200 OK When a SOAP operation generates a response SOAP message, the HTTP response code for successful processing is 200 OK. This response code indicates that the reply message is not a fault, that it does contain a normal SOAP response message.
  • 202 Accepted This response code means that the request was processed successfully but that there is no SOAP response data. This type of SOAP operation is similar to a Java method that has a return type of void.
  • The HTTP 201 Created success status response code indicates that the request has succeeded and has led to the creation of a resource. ... The common use case of this status code is as the result of a POST request.

Error Codes

  • 400 Bad Request This error code is used to indicate that either the HTTP request or the XML in the SOAP message was not well formed.

  • 500 Internal Server Error This code must be used when the response message in a Request/Response MEP is a SOAP fault.
  • 504-gate way timeout error, for page crash then
  • 503-services is not available

  • 415 Unsupported Media Type HTTP POST messages must include a Content-Type header with a value of text/xml. If it's any other value, the server must return a 415 Unsupported Media Type error.

  • 405 Method Not Allowed If a Web service receives a SOAP message via any HTTP method other than HTTP POST, the service should return a 405 Method Not Allowed error to the sender.
  • The 401 Unauthorized Error is an HTTP response status code indicating that the request sent by the client could not be authenticated.
  • 404:bad request in body mistake
  • 402:the request page is not available
  • 403-forbidden
3-WADL & WSDL difference?
  • Web Services Description Language #Web Application Description Language
  • WSDL is an XML language for describing web services. Used to describe SOAP-based web services. #WADL is an XML file-format . It is an XML vocabulary for expressing the behavior of HTTP resources. It is an XML to describe RESTful web services.
  • Only XML Parameter#Not a standard

4-Swagger-Swagger is an Interface Description Language for describing RESTful APIs expressed using JSON. Swagger is used together with a set of open-source software tools to design, build, document, and use RESTful web services. 
Https validation.we do function validation

5-any defects from swagger? functional defect,tag is not available in section
--testing for HTTP working fine for swagger
---HTTPS we need to change field any drop-down option, swagger document gor for https.


5- Remove NS1: id and NS2: id in XML?

open notepad++ > click find> Select Regular Expression in button>Click Replace tab> 
In place Find what: entered ns1expression
Replace With keep blank> click on Replace All.
The same things do for ns2 also.

For ns1:<ns1:id>[A-z 0-9]*<\/ns1:id>
For ns2: <ns2:id>[A-z 0-9]*<\/ns2:id>

6-Past a new xml what critera we need to follow?
1-Remove ns1 and ns2 id
2-Remove global id
3-remove locale id
4-Enter unquie code




Comments

Popular posts from this blog

Installation of gem5 Simulator for FS Mode(Full System Mode)

Installation of gem5 Simulator for SE Mode(System Call Emulation Mode)

Running gem5 with parsec benchmark