我对肥皂一无所知,对我所做的事情我也只知道一点点。任何试图解决这个问题或找到一个关于发生什么的描述都是徒劳的。我似乎无法摆脱一个不断唠叨的例外:
SoapFault exception: [500] Username required in path\index.php:38<br />
Stack trace:<br />
#0 path\index.php(38): SoapClient->__soapCall('createPlayer', Array)<br />
#1 {main}wsdl在这里- http://www.laifacai.com/soap/gameprovider?wsdl
这个在我的php里。
$soap_options = array('trace' => 1, 'exceptions' => 1 );
$client = new SoapClient("http://www.laifacai.com/soap/gameprovider?wsdl", array( 'login' => "user", 'password' => "pass"));
var_dump ($client->__getFunctions ());
if (!class_exists('SoapClient')){
die ("You haven't installed the PHP-Soap module.");
} else {
try {
$res = $client->__soapCall('createPlayer', array('username'=>'mstest1', 'password'=>'12345678')));
} catch (SOAPFault $f) {
echo "<pre>" . $f . "</pre>";
}
}基本地说,我有一些关于世界的方法,我想要处理。我认为createPlayer将是最简单的,我可以从那里开始学习,但我不能正确,我不知道哪里错了,我找不到它。这并不重要,如果我传递一个空数组或一个完整的数组,总是相同的“用户名所需”。
编辑: Wsld链接编辑
发布于 2013-10-24 09:53:18
上面写着“所需的用户名”,所以试着提供它。目前您只提供username (请注意较低的大写)。SOAP是区分大小写的。
另外,我觉得你的
$res = $client->__soapCall('createPlayer',
array('username'=>'mstest1', 'password'=>'12345678')));应该是
$SoapCallParameters = array('username'=>'mstest1', 'password'=>'12345678');
$res = $client->__soapCall('createPlayer',
array('parameters'=>$SoapCallParameters));根据您的WSDL文档,应该提供
array(
'agentid'
'username'
'password'
'currencycode'
'countrycode'
'nickname'
'fname'
'lname'
)对于createPlayer来说,仅仅使用用户名和密码是不够的。
https://stackoverflow.com/questions/19562360
复制相似问题