Inserting data from one server to another running PHP.

There is a simple way to accomplish the above mentioned process i.e, webservices. The logic behind a web service is  very simple. A web service could be implemented by the exchange of data between a server and a client, using SOAP, XML or JSON.

First of all, implement a web-service on the database side and then on the client side and both require authentication.A login username and password is require for accomplishing this. The popular example of a web service is RSS feed. All the data exchange is handled through the standard HTTP Protocol using port 80 and the data is gotten from the server either in the form of XML or JSON.  Below, i am giving a brief introduction to the web service technologies.

 SOAP    (Simple Object Access Protocol).

  SOAP is a plateform independent lightweight protocol for exchange of information. SOAP is also a w3c recommendation.  SOAP is basically an XML document which is comprised on mainly three elements, an envelope, which checks the document that it is an XML document or not. A header element and the body, which actually contains the call and response information.

A SOAP request:

 POST /InStock HTTP/1.1
 Content-Type: application/soap+xml; charset=utf-8   
  //  i recommend to specify the characterset encoding becuase windows based servers could also return sometime cp1252 encoding instead of   utf-8
 Content-Length: 111  //  length of the content

 <?xml version="1.0"?>
 <soap:Envelope xmlns:soap="" soap:encodingStyle="">  
 <soap:Body xmlns:m="">  

The SOAP response:

 HTTP/1.1 200 OK
 Content-Type: application/soap+xml; charset=utf-8
 Content-Length: 111

 <?xml version="1.0"?>
 <soap:Body xmlns:m="">

The above process can be made more secure by implementing authentication on server side and using curl at client side to connect.

Plz share this on

Submit to DeliciousSubmit to DiggSubmit to FacebookSubmit to Google PlusSubmit to StumbleuponSubmit to TechnoratiSubmit to TwitterSubmit to LinkedIn


You have no rights to post comments

Enjoy best web development services at an affordable price. Looking forward to build a good relationship and serve you better...

Copyright © 2017. All rights reserved.