1

I hope someone can help me because I am looking for the solution since 2 working days...

I have a php website which need to request a distant webservice. When I try it on my computer (Win7 + WAMP), it works well. When I try it on the webserver (CentOs6), it return me the following error :

SOAP-ERROR: Parsing WSDL: Couldn't load from
'http://ip_address:8080/gss-0.1/FileUtilities?wsdl' : failed to load
external entity "http://ip_address:8080/gss-0.1/FileUtilities?wsdl"

NB: the webservice is on the same network of my webserver (I do not use the same IP/port).

I know that the WSDL is accessible from the webserver because it is accessible using curl linux function.

curl http://ip_address:8080

My php code is:

<?php
$wsdl = "http://ip_address:8080/gss-0.1/FileUtilities?wsdl";

try{
        $client = new SoapClient($wsdl ,array('trace' => 1,
                                        'exceptions'=> 1,
                                        'cache_wsdl' => WSDL_CACHE_NONE
                                        ));
}
catch(Exception $e) {
        echo $e->getMessage();
}?>
Yocel1
  • 23
  • 5
  • Something external to this script is blocking access to ip_address or port 8080. Whether it be a firewall, an unreachable service, or a routing issue, the script is unable to make a connection to that IP address. – drmarvelous Aug 18 '14 at 14:25
  • Not sure. On the webserver I can access to the WSDL using the curl command. – Yocel1 Aug 18 '14 at 14:27

2 Answers2

1

OK I found a solution but I don't understand the problem...

So I execute this Linux command

setsebool -P httpd_can_network_connect on

And now all is running !

Response here: Thanks to user2533111

Community
  • 1
  • 1
Yocel1
  • 23
  • 5
0

If its not firewalled there at your web server and its working in your local but not at your webserver(CentOS). its might be a case of different PHP version and php.ini settings. Can you compare your PHP version and those below extensions in your CentOs server with your WAMP at local.

S0AP, php_openssI, openssI, curI;

Tapaswi Panda
  • 1,041
  • 7
  • 13
  • I compare the php.ini files and they are quiet similar. SOAP, php_openssl, openssl and curl are all installed and they work. I also try with a public wsdl and it works... So the php configuration must be good too... Now the question is: why it works with ('http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl') and it does not work with my proper WSDL created by JAX-WS ? – Yocel1 Aug 18 '14 at 15:51
  • Here is a similar link that might help you. http://stackoverflow.com/questions/21861077/soap-error-parsing-wsdl-couldnt-load-from-but-works-on-wamp – Tapaswi Panda Aug 18 '14 at 15:55