Friday, 17 April 2015

Web Services interview questions and answers for fresher

Web Services interview questions and answers for fresher


Question: What is web services?
It is method of communication between two devices Over the network. With use of web service we can send the request to another device and get the response.
For Example:
We want to know the current weather of "New York, USA".
For this we contact a web service which store the weather information.v Now, We just call
http://domain.com/know-weather-information/city/New York, USA [It is dummy, just for example]
(Here i have pass city name with country (It is request), they will return the city weather information(It is response))



Question: What are famous web service protocols?
In development world, we listen someone using SOAP another one using JSON and third one is using XML-RPC.
Many times, it confuse us that What is these and whey they are using different.
These all are webservice because they are using for exchanging the information.
These are web service but they using different protocol as per their requirement.

Following are some famous protocol used by developers.

  • XML-RPC - XML Remote Procedure Call
  • REST - Representational State Transfer
  • SOAP - outgrowth of XML-RPC, originally an acronym for Simple Object Access Protocol
  • JSON-RPC
  • JSON-WSP
  • UDDI -Universal Description, Discovery, and Integration
  • WPS - Web Processing Service
  • XINS Standard Calling Convention - HTTP parameters in (GET/POST/HEAD), POX out.




Question: What is XML-RPC?
XML-RPC is one of the protocols that use XML for messages between two server.v It is used to "Remote Procedure Calls" using XML.


Question: What is JSON-RPC?
JSON-RPC is one of the protocols that use JSON for messages between two server.
It is used to "Remote Procedure Calls" using JSON.
Format of JSON
{ "version": "1.1", "result": "done", "error": null, "id": "194521489" }



Question: What is JSON-WSP?
It is another term of Web Services only difference is that It uses JSON instead of XML for exchanging the information between two server.
JSON-WSP is simpler as compare to Web Service.



Question: What is SOAP?
SOAP is the protocol used in order to do transfers the data among computers.


Question: What is WSDL?
WDSL is that which describes the interface used in a specific service.



Question: What is Web API? A Web API is a Web services where emphasis has been moving to simpler representational state transfer (REST).
RESTful APIs do not require XML-based Web service protocols (SOAP and WSDL) to support their interfaces.
RESTful mostly use JSON, because it is fast and human readable.


Question: What is REST?
Representational State Transfer (REST) is a software architecture(protocol) style consisting of guidelines and practices for creating scalable web services.
It is simpler as compare to SOAP, WSDL based web services.
It is mostly used by Web pages using HTTP Request.


Question: What are differnet channels used for communication using web services?
HTTP/GET, HTTP/POST and SOAP


Question: What kind of security is needed for web services?
Web services should give response only to autorization calling server.
With each request, sender must send the authorization code and that must be validate by service provider.
We can use SSL for add extra security.



Question: Define Entrust Privacy Service?
It deals with security and confidentiality. This service encrypts data to ensure that only concerned parties can access the data.


Question: What is PKI?
It means Public-Key Infrastructure.


Question: What tools are used to test a SOAP and RESTFul services?
"SoapUI" for SOAP Web service and "Firefox poster plugin" for RESTFul services.


Question: What are distributed technologies?
The increasing ratio of distributed applications has raised demand for distributed technologies.



Question: What is the Web service protocol stack?
The Web service protocol stack is an evolving set of protocols used to define, discover, and implement Web services.


Thursday, 16 April 2015

Why error 524 a timeout occurred

Why error 524 a timeout occurred

This error is CloudFlare error that denoting your web page is loading slow, due to any of below reason.
  • Website is Slow.
  • Temporary internet is slow.
  • Some function in website is talking long time to respond.
  • Any of mysql-query is talking more time to respond.



 In this case either you need to
increase the performance of website
OR
increase the max_execution_time on website.

What is meaning of this Error.
A 524 error states that CloudFlare was able to make a TCP connection to the origin(your website server location), but the origin server did not reply with a HTTP response before the connection timed out.
It means that CloudFlare is able to make a network connection with origin server (your website), but the origin server(webiste) took too long time to respond to the request.


If you get this error first time, then you can refresh the page OR open the website in another browser.

As we know, Most of time website execution limit is 30 seconds but if website is takes more time (more than 30 seconds) to reply, then cloudFlare did not wait and through 524 error.
This error comes when server is on cloudFlare.


If this issue persistent in your website and comes very often then you have to work hard on your website..

If this issue is coming many times then it means your website is loading very slow.
you need to optimize.

How to increase the Performance of website?
1. Optimize the application Flow.

2. Optimize the MySQLI Query.

3 - Make Fewer HTTP Requests (means Less Ajax Call)

4 - Use a Content Delivery Network (CDN)

5 - Add an Expires Header
http://stackoverflow.com/questions/4603076/add-expire-headers-in-php-cant-make-it-work

6 - Gzip Components
http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/

7 - Put Stylesheets at the Top (CSS Files in head tag)

8 - Put Scripts at the Bottom (Js files in footer)

9 - Avoid CSS Expressions (e.g 100/2)

See full articles http://www.web-technology-experts-notes.in/2013/10/14-steps-to-reduce-the-loading-time-of-website.html