问题
I have a php code that uses soap
I get the error
ERROR: WSDL - SOAP-ERROR: Parsing WSDL: Couldn't load from
It's a security wsdl so I need to send also username and password. what is wrong in my code? I see it at web and does'nt work from soap in php code. here is my code:
<?php
ini_set("soap.wsdl_cache_enabled", "0");
$soap_url = 'http://some-ip/prod/app/soap/user/storeitemws?WSDL';
$sh_param = array(
'username' => 'aya',
'password' => 'aya');
$soap_client = new SoapClient($soap_url);
$test = $soap_client->Authenticate($sh_param);
echo $test . "\nDone";
?>
thanks
回答1:
See in the documentation:
$client = new SoapClient("some.wsdl", array('login' => "some_name",
'password' => "some_password"));
change username
to login
and try the above method
回答2:
Is Authenticate()
a SOAP method? In what way is the wsdl secured? What happens if you visit it using the browser?
The SoapClient does not support authentication on the WSDL it's built from, so you'll have to download the WSDL manually (using cURL for example) and create the SoapClient from that file.
回答3:
for using on localhost, install WAMP.
Click on wamp tray icon > PHP Services > and enable these options:
openssl,
php_openssl,
curl;
SOAP,
p.s. possibly, some of free hostings dont have these options
回答4:
Maybe some firewall ? you cannot access to the server ?
来源:https://stackoverflow.com/questions/10550505/error-wsdl-soap-error-parsing-wsdl-couldnt-load-from