soap - PHP Server was unable to process request -
this coding can 1 help:
<?php class clswsseauth { private $username; private $password; private $meruser; private $merpass; function __construct($username, $password) { $this->username=$username; $this->password=$password; //$this->merhcantusername=$meruser; //$this->merhcantpassword=$merpass; } } /*class clswssetoken { private $usernametoken; function __construct ($innerval){ $this->usernametoken = $innerval; } }*/ ?> <!--step2: create soap variables username , password --> <?php include("lib/nusoap.php"); $username = $_request['usname']; $password = $_request['uspass']; $meruser = $_request['merusname']; $merpass = $_request['meruspass']; //check provider security name-space using. $strwssens = "http://localhost/royal_new/"; $objsoapvaruser = new soapvar($username, xsd_string, null, $strwssens, null, $strwssens); $objsoapvarpass = new soapvar($password, xsd_string, null, $strwssens, null, $strwssens); $objsoapvarmeruser = new soapvar($meruser, xsd_string, null, $strwssens, null, $strwssens); $objsoapvarmerpass = new soapvar($merpass, xsd_string, null, $strwssens, null, $strwssens); ?> <!--step3: create object auth class , pass in soap var --> <?php $objwsseauth = new clswsseauth($objsoapvaruser, $objsoapvarpass); ?> <!--step4: create soapvar out of object of auth class--> <?php $objsoapvarwsseauth = new soapvar($objwsseauth, soap_enc_object, null, $strwssens, 'usernametoken', $strwssens); ?> <!--step5: create object token class--> <?php //$objwssetoken = new clswssetoken($objsoapvarwsseauth); ?> <!--step6: create soapvar out of object of token class--> <?php //$objsoapvarwssetoken = new soapvar($objwssetoken, soap_enc_object, null, $strwssens, 'usernametoken', $strwssens); ?> <!--step7: create soapvar 'security' node--> <?php //$objsoapvarheaderval=new soapvar($objsoapvarwssetoken, soap_enc_object, null, $strwssens, 'security', $strwssens); ?> <!--step8: create header object out of security soapvar--> <?php //$objsoapvarwsseheader = new soapheader($strwssens, 'security', $objsoapvarheaderval,true, 'http://services.l2payments.com/merchantservices.asmx?wsdl'); //third parameter here makes 'mustunderstand=1 //forth parameter generates 'actor="http://abce.com"' ?> <!--step9: create object of soap client--> <?php $param = array('merhcantusername' => $username,'merhcantpassword' =>$password); $objclient = new soapclient('http://services.l2payments.com/merchantservices.asmx?wsdl', $param); ?> <!--step10: set headers soapclient object --> <?php //$objclient->__setsoapheaders(array($objsoapvarwsseheader)); ?> <!--step 11: final call method --> <?php try { $objresponse = $objclient->__soapcall('loginrequest', $param); // note: same results without or without exceptions => true } catch(exception $e) { var_dump($e); } ?>
i getting error:
object(soapfault)#9 (9) { ["message:protected"]=> string(96) "server unable process request. ---> object reference not set instance of object." ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(32) "c:\wamp\www\royal_new\server.php" ["line:protected"]=> int(102) ["trace:private"]=> array(1) { [0]=> array(6) { ["file"]=> string(32) "c:\wamp\www\royal_new\server.php" ["line"]=> int(102) ["function"]=> string(10) "__soapcall" ["class"]=> string(10) "soapclient" ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(12) "loginrequest" [1]=> array(2) { ["merhcantusername"]=> string(5) "manoj" ["merhcantpassword"]=> string(5) "manoj" } } } } ["faultstring"]=> string(96) "server unable process request. ---> object reference not set instance of object." ["faultcode"]=> string(11) "soap:server" ["detail"]=> string(0) "" }
Comments
Post a Comment