2015-04-29 76 views
0

我有一个SOAP客户端代码来从elit公司获得汽车零件,但我有一个奇怪的结果。Soap失败函数响应

object(stdClass)[225] 
    public 'return' => 
    object(stdClass)[226] 
     public 'unitPrice' => float 0 
     public 'vat' => int 0 

我的PHP代码:

getItem function must have an array parameters:

7 => string 'struct getItem { 
    string company; 
    string login; 
    string password; 
    string activeItemNo; } 

public function demo($piesa) 
{ 

    $wsdl = 'http://icelit02.elit.cz:7606/InterCompany-1.10.0/BuyerService?wsdl'; 
    $opts = array('http' => array('protocol_version' => '1.0')); 
    $context = stream_context_create($opts); 
    $client = new SoapClient($wsdl, array('stream_context' => $context)); 


    var_dump($client->__getFunctions()); 
    var_dump($client->__getTypes()); 
    $response=$client->__call('getItem', array(array('company'=>'ELIT_RO', 'login'=>'autocomplet15', 'password'=>'elena10', 'activeItemNo'=>'M043 22 00'))); 
    dd($response); 
    } 
+0

你可以直接调用'$ client-> getItem($ arguments)'。你也可以显示'__getFunctions'结果吗?请注意在此处显示您的密码。 –

+0

我相信,你不应该使用嵌套数组,只是简单的数组作为一个基础:'$ response = $ client-> getItem(array('company'=>'ELIT_RO','login'=>'login','password '=>'password','activeItemNo'=>'M043 22 00'));' –

+0

Honza Haering:如果我直接调用getItem,我收到一个错误:Function not found ...或类似的东西。 –

回答

0

'activeItemNo'=>'M043 22 00'该项目并不在目录中存在。尝试一些现有的,例如'activeItemNo'=>'ATE 390569'

+0

非常感谢您的回答 –