php - Web Service with .net and nusoap -
i using nusoap connect .net service, error "notice: undefined variable: header in c:\xampplite\htdocs\newsoap\searchwwcc.php on line 54
fatal error: uncaught soapfault exception: [client] function ("serializeenvelope") not valid method service in c:\xampplite\htdocs\newsoap\searchwwcc.php:54 stack trace: #0 [internal function]: soapclient->__call('serializeenvelo...', array) #1 c:\xampplite\htdocs\newsoap\searchwwcc.php(54): soapclient->serializeenvelope('
here reference code using
require_once('lib/nusoap.php'); $serverpath ='https://service.website.net/ws/bridge.asmx?wsdl'; $soapclient = new soapclient($serverpath); $soapaction = "http://connect2.askadmissions.net/webservices/getcontact"; $body='<?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <getcontact xmlns="http://service.website.net/webservices/"> <clientname>clientname</clientname> <passkey>*******</passkey> <searchcriteriaxml> <![cdata[ <attributes> <attribute> <name>email</name> <value>name@name.com</value> <operator>equals</operator> </attribute> </attributes> ]]> </searchcriteriaxml> <attributesxml> <![cdata[ <attributes> <attribute> <name>firstname</name> </attribute> <attribute> <name>lastname</name> </attribute> </attributes> ]]> </attributesxml> </getcontact> </soap:body> </soap:envelope>'; $soapmessage = $soapclient->serializeenvelope($body,$header,array(),'document', 'literal'); $result = $soapclient->send($body, $soapaction); echo $soapclient->response;
i found out wrong :
i change line :
$soapclient = new soapclient($serverpath);
to
$soapclient = new nusoap_client($serverpath);
which fixed error getting , started giving me blank page. found blank page because curl not installed.
used following code echo error:
$soaperror = $soapclient->geterror(); if (! empty($soaperror)) { $errormessage = 'soapclient failed: ' . $soaperror; throw new exception($errormessage); }
after started working getting warning :
notice: undefined property: nusoap_client::$operation in c:\xampplite\htdocs\newsoap\lib\nusoap.php on line 7674
i went nusoap.php , before line inserted :
if(empty($this->operation)) { $this->operation = ""; }
Comments
Post a Comment