ERROR: WSDL - SOAP-ERROR: Parsing WSDL: Couldn't load from

牧云@^-^@ 提交于 2019-12-12 20:51:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!