1

I'm working on payment gateway API and API is based on the SOAP request. I have tested it on my local PC (Ubuntu + php 7.2) and it's working fine locally.

my code look like:

$options = array(
    'cache_wsdl' => 0,
    'trace' => 1,
    'stream_context' => stream_context_create(
        array(
            'ssl' => array(
                'verify_peer' => false,
                'verify_peer_name' => false,
                'allow_self_signed' => true
            )
        )
    )
);

$soapclient = new SoapClient("domain-name", $options);

but when I moved the code on the server (Cent OS + PHP 5.6) it stop working with following error:

SOAP-ERROR: Parsing WSDL: Couldn't load from domain-name : failed to load external entity domain-name

i know there are lots of similar question have answered on the site (like this, this, this and may more) but I have tried all of them but no luck.

please help me to fix this issue.

thanks.

krlv
  • 2,310
  • 1
  • 12
  • 15
  • I have also checked remote server with curl using SSH and it return Connection timed out. but same command returning response on my local Ubuntu PC – sanju choudhary Feb 07 '19 at 20:31
  • 1
    If you can't curl it on your server, then your server has some sort of connection issue. This isn't a programming question it's a networking or server config question and probably belongs on https://serverfault.com/. – geoidesic Feb 07 '19 at 20:45

1 Answers1

0

I had the same problem. my soap API was working on local PC but not working on the server.

then I check the port 8080 status of my server with the following command:

# netstat --listen

or

# netstat -l

then I found that the port was closed. and after opening it SOAP API start working

I hope this will helps you

Rajinder
  • 1,131
  • 1
  • 14
  • 29