nymets1104 Posted April 7, 2013 Share Posted April 7, 2013 (edited) I am attempting to implement an API on my website using WSDL through SOAP. My hosting company (fatcow) does not support PHP SOAP. They do however support PEAR SOAP 0.9.1. I have continuosly ran into the error: Server was unable to process request. --- Object reference not set to an instance of an object. I believe I am possibly forming the XML SOAP request incorrectly. The getLastRequest() method is not returning anything for debugging. The var_dump() method is returning an enormous amount of information. I am looking for some guidance in debugging this SOAP call. I have included my php code below with the resulting XML SOAP request found in my var_dump. <?php require_once 'SOAP/Client.php'; $WSDL=new SOAP_WSDL('https://api.mindbodyonline.com/0_5/SiteService.asmx?wsdl',array(trace=>1)); $proxy=$WSDL->getProxy(); $options=array('soapaction' => 'http://clients.mindbodyonline.com/api/0_5/GetLocations'); $params = array('Request'=>array('SourceCredentials' => array('SourceName'=>'StudioSevaYoga','Password'=>'*************','siteIDs'=>array('int'=>'23661')),'XMLDetail'=>'Full','PageSize'=>'10','CurrentPageIndex'=>'0')); $ret = $proxy->call("GetLocations",$params,$options); var_dump($ret); ?> POST /0_5/SiteService.asmx HTTP/1.0 User-Agent: PEAR-SOAP @version@-beta Host: api.mindbodyonline.com Content-Type: text/xml; charset=UTF-8 Content-Length: 862 SOAPAction: "http://clients.mindbodyonline.com/api/0_5/GetLocations" Connection: close <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <GetLocations> <Request> <SourceCredentials> <SourceName xsi:type="xsd:string">StudioSevaYoga</SourceName> <Password xsi:type="xsd:string">********************</Password> <siteIDs> <int xsi:type="xsd:string">23661</int></siteIDs></SourceCredentials> <XMLDetail xsi:type="xsd:string">Full</XMLDetail> <PageSize xsi:type="xsd:string">10</PageSize> <CurrentPageIndex xsi:type="xsd:string">0</CurrentPageIndex></Request></GetLocations> </SOAP-ENV:Body> </SOAP-ENV:Envelope> WSDL: https://api.mindbodyonline.com/0_5/SiteService.asmx?wsdl My php page throwing error: http://studio-seva.com/pearSoap5.php Any help would be greatly appreciated. Edited April 7, 2013 by nymets1104 Quote Link to comment https://forums.phpfreaks.com/topic/276635-pear-soap-debugging/ Share on other sites More sharing options...
Solution nymets1104 Posted April 8, 2013 Author Solution Share Posted April 8, 2013 For anyone attempting to use PEAR SOAP with their Webservice, I was able to generate the proxy code for each class from the WSDL by using the PEAR SOAP method generateProxyCode() to generate PEAR SOAP compliant code that is slightly different than the standard php. Example: http://stackoverflow.com/questions/16...PEAR SOAP documentation: http://pear.php.net/package/SOAP/docs...I was finally able to make a valid request and get a response after nearly 3 weeks of hair pulling and testing with my webservice Quote Link to comment https://forums.phpfreaks.com/topic/276635-pear-soap-debugging/#findComment-1423482 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.