开发者

Communication between two server

can any one please tell me what are the other ways to build the communication between two website's server wi开发者_StackOverflow社区thout using "nusoap"


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

The other website can then parse the params using the $_GET, and can reply (for example in XML). You can then parse the response.

If you want more options, Curl and its libraries are not that hard in PHP, and can do much more.


If you are talking about web-services take the php build in soap extension.

If you only what to receive the content of another website try fsockopen, curl or the php pear extension HTTP_Request2


$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);

A http request to post ur data to another server to the mentioned url .


There are more ways to do that.. The easiest options would be communication through http as if you were reading contents of a page:

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

or for more advanced task you can use sockets:

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


You should use the built in soap extension for PHP rather than Nusoap.

As far as communication between the two servers, I'm unsure of what you're trying to do. If the servers are controlled by you (or your company) what you should do instead is mount a virtual drive and simply write/read files off the mount which effectively creates a communication between the servers. Might be a better solution than a esb especially if it's controlled by you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜