Communication between two servers

Can someone tell me what are the other ways to build communication between two site servers without using "nusoap"

+2


a source to share


5 answers


If you are talking about webservices then run php build on the soap extension .



If you want to get content from another website try fsockopen , curl or php pear extension HTTP_Request2

+1


a source


You can just call the website url using fopen("http://www.somesite.com/script.php?p1=val1&p2=val2")

.

Another website can then parse the parameters with $_GET

and can respond (eg in XML). Then you can parse the answer.



If you need more features, Curl

and its library is not so difficult in PHP and can do much more.

+2


a source


$options = array('http' => array('header'  => "Content-type: application/x-www-form-urlencoded\r\n",'method'  => 'POST','content' => http_build_query($yourData)));
$context  = stream_context_create($options);
$result = file_get_contents("www.abc.com", false, $context);

      

HTTP request to send ur data to another server to the specified url.

+1


a source


There are more ways to do this. The simplest options are to communicate over http, as if you were reading the page content:

http://php.net/manual/en/function.file-get-contents.php

or for a more complex task, you can use sockets:

http://php.net/manual/en/book.sockets.php

0


a source


You should use the built-in soap extension for PHP, not Nusoap.

As far as communication between the two servers is concerned, I'm not sure what you are trying to do. If the servers are controlled by you (or your company), then you should instead mount the virtual disk and just write / read files from the mount, which effectively creates communication between the servers. May be a better solution than esb, especially if controlled by you.

0


a source







All Articles