I am trying to use a web service for the first time via PHP using the Zend_soap_client.
Here is the code I am using:
I have put some logging into other places of the code and here is what I am seeing:Code:public function talkAction() { Cds_Log::traceEntry(); $client = new Zend_Soap_Client("http://serv:10021/web/services/WSV0201?wsdl", array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_1)); $myFunctions = $client ->getFunctions(); foreach($myFunctions as $func) { Cds_Log::trace("function: " . $func); } $types = $client->getTypes(); foreach($types as $type) { Cds_Log::trace("type: " . $type); } $result = $client->wsv0201(array('param0' => 'prototype')); echo $result->wsv0201Response; Cds_Log::traceExit(); }
I believe I am calling the correct function and passing the parameters correctly but I get the following errors:Code:2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | function: wsv0201_XMLResponse wsv0201_XML(wsv0201_XML $parameters) | Cds_ProductsWebService_PrototypeController | talkAction 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | function: wsv0201Response wsv0201(wsv0201 $parameters) | Cds_ProductsWebService_PrototypeController | talkAction 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | type: struct wsv0201 { WSV0201Input param0; } | Cds_ProductsWebService_PrototypeController | talkAction 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | type: struct WSV0201Input { string _INPUTDATA; } | Cds_ProductsWebService_PrototypeController | talkAction 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | type: struct wsv0201Response { WSV0201Result return; } | Cds_ProductsWebService_PrototypeController | talkAction 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | type: struct WSV0201Result { string _INPUTDATA; } | Cds_ProductsWebService_PrototypeController | talkAction 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | type: struct wsv0201_XML { WSV0201Input param0; } | Cds_ProductsWebService_PrototypeController | talkAction 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | type: struct wsv0201_XMLResponse { string return; } | Cds_ProductsWebService_PrototypeController | talkAction 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | name: wsv0201 | Zend_Soap_Client | __call 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | arg: Array | Zend_Soap_Client | __call 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | key: param0 value: prototype | Zend_Soap_Client | __call 2010-03-12T20:35:51+00:00 DEBUG (7): a94360c19d8831ba51f5c7148ef3e8b0 | request: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://my.domain.com/xsd"><SOAP-ENV:Body><ns1:wsv0201><ns1:param0/></ns1:wsv0201></SOAP-ENV:Body></SOAP-ENV:Envelope> | Zend_Soap_Client | _doRequest
From what I can tell from the log is the request is not being built correctly. I am not passing the value or prototype for param0. Not sure this should matter though as the param0 is nillable according to the wsdl.Code:java.lang.RuntimeException: Invocation of program failed. AS400Message (ID: CEE9901 text: Application error. *N unmonitored by *N at statement *N, instruction X'4000'.):com.ibm.as400.access.AS400Message@21f421f4 Trace: #0 D:\opt\eclipse\workspace\magento\lib\Zend\Soap\Client.php(1108): SoapClient->__soapCall('wsv0201', Array, NULL, NULL, Array) #1 [internal function]: Zend_Soap_Client->__call('wsv0201', Array) #2 D:\opt\eclipse\workspace\magento\app\code\local\Cds\ProductsWebService\controllers\PrototypeController.php(51): Zend_Soap_Client->wsv0201(Array) #3 D:\opt\eclipse\workspace\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Cds_ProductsWebService_PrototypeController->talkAction() #4 D:\opt\eclipse\workspace\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(248): Mage_Core_Controller_Varien_Action->dispatch('talk') #5 D:\opt\eclipse\workspace\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(173): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #6 D:\opt\eclipse\workspace\magento\app\code\core\Mage\Core\Model\App.php(304): Mage_Core_Controller_Varien_Front->dispatch() #7 D:\opt\eclipse\workspace\magento\app\Mage.php(596): Mage_Core_Model_App->run(Array) #8 D:\opt\eclipse\workspace\magento\index.php(81): Mage::run('base', 'website') #9 {main}
Anybody have any ideas on this?