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="">  

{loadposition inart}

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. {loadposition social}

Add a Comment

Your email address will not be published. Required fields are marked *


My name is Nohman Habib and I am a web developer with over 10 years of experience, programming in Joomla, Wordpress, WHMCS, vTiger and Hybrid Apps. My plan to start is to share my experience and expertise with others. Here my basic area of focus is to post tutorials primarily on Joomla development, HTML5, CSS3 and PHP.

Nohman Habib


Request a Quote