【发布时间】:2014-11-14 01:04:18
【问题描述】:
$ns = "auth";
$wsdl = "(http://example.com/api?wsdl)";
//Create our Auth Object to pass to the SOAP service with our values
$rand = rand(11111111,99999999);
$srt = 'ABCD';
$auth->username = 'hopp_api_user';
$auth->digestkey = sha1($srt);
$auth->nonce = $rand;
$auth->request_time = date('Y-m-d H:i:s');
$login = new SoapVar($auth, SOAP_ENC_OBJECT);
$authenticate = new SoapHeader($ns,'userauthentication',$login, false);
$client = new SoapClient($wsdl,array('cache_wsdl' => 0,'trace'=>1));
$client->__setSoapHeaders(array($authenticate));
$aaass ->offer_id ='322';
$aaass ->username ='user';
$obje = new SoapVar($aaass, SOAP_ENC_OBJECT);
$aaa = $client->offerActivationByOfferID($obje);
/////////////////////////////////////// ///////////////////////////
SoapFault 异常:[SOAP-ENV:Client] 错误在 /var/www/html/hutch-alco/application/controllers/TestController.php:65 中找不到参数 堆栈跟踪:#0 /var/www/html/ hutch-alco/application/controllers/TestController.php(65): SoapClient->__call('offerActivation...', Array) #1 /var/www/html/hutch-alco/application/controllers/TestController.php( 65): SoapClient->offerActivationByOfferID(Object(SoapVar)) #2 /var/www/html/hutch-alco/library/Zend/Controller/Action.php(513): TestController->sujithAction() #3 /var/ www/html/hutch-alco/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('sujithAction') #4 /var/www/html/hutch-alco/library/Zend/Controller /Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #5 /var/www/html/hutch-alco/application/bootstrap.php(51): Zend_Controller_Front->dispatch( ) #6 /var/www/html/hutch-alco/public/index.php(8): require('/var/www/html/h. ..') #7
我收到了这个错误...
谁能帮帮我............
【问题讨论】:
-
我也有同样的问题...整天都在努力解决...您找到解决方案了吗?
-
我遵循了这个例子......当得到与你相同的错误时。 getrouty.com/…
-
嗨,我像这样更改我的 std 类 /n $std = new stdClass(); $std->登录 = $string;并添加这样的肥皂版本 $client = new SoapClient($wsdl,array('cache_wsdl' => 0,'trace'=>1,'soap_version' => SOAP_1_2));之后,我将我的 web 服务身份验证类输入参数类型更改为字符串。然后它工作正常。请试试这个。
标签: zend-framework soap soap-client zend-soap