开发者

NUSOAP problem using free web hosting sites

开发者 https://www.devze.com 2023-02-21 23:52 出处:网络
I\'ve been trying to figure out what\'s wrong and what is the problem with this following PHP code, which is trying to make a SOAP call. I can\'t get it to work when I host the PHP on free web hosting

I've been trying to figure out what's wrong and what is the problem with this following PHP code, which is trying to make a SOAP call. I can't get it to work when I host the PHP on free web hosting sites

include_once("nusoap/lib/nusoap.php");

// create the client and define the URL endpoint 
$client = new nusoap_client('http://xxxyyy.zzz:1881/');

// set the character encoding, utf-8 is the standard. 
$client->soap_defencoding = 'UTF-8'; 

$client->call('sendSMS', array( 'uName' => 'kd81fg',
          'uPin' => '18416',
          'MSISDN' => '09156300965',
          'messageString' => 'THIS IS A SAMPLE MESSAGE',
          'Display' => '1',
          'udh' => '',
          'mwi' => '',
          'coding' => '0' ),
          "http://ESCPlatform/xsd");

When I tried using this hosted on my localhost, it work, but when I try to upload it (I tried so many free web hosting sites) to a web hosting site, and try to run it, it will not work.

I don't know what's wrong but I'm pretty sure that the code is perfect. I'm guessing that the free web hosting sites that I tried do not allow SOAP / XML , or maybe cURL is disabled, or url_fopen is Off on their php.ini (config) or something . I don't really know what's wrong right now and I need to finish what I'm doing right away.

UPDATE: I tried to echo what's the error and here what it says

HTTP Error: Couldn't open socket connection to server http://xxxyyy.zzz:1881/, Error (111) Connection refused.

I checked the phpinfo for curl and stuff.

I was thinking of that too that maybe the problem is on the free hosts that they开发者_C百科 dont allow connection on port 1881, but I tried to scan and check if 1881 is open on my localhost, and it says my 1881 is closed, and now I'm confused.


Probadly port 1881 is closed on the free hosts. Try to close it on your pc/router. If the same error appears than this should be the problem.

EDIT: Did you check the phpinfo() for curl and stuff?

EDIT 2: Don't you have to add the client's host to your profile at the service provider's site like when you want to use the Google maps API?


Very often free web hosts will block outgoing ports. If you can set up a reverse proxy with apache or nginx (I'm assuming you're hosting the SOAP server).

0

精彩评论

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