Jump to content

PEAR SOAP debugging

Go to solution Solved by nymets1104,

Recommended Posts

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.

require_once 'SOAP/Client.php';

$WSDL=new SOAP_WSDL('https://api.mindbodyonline.com/0_5/SiteService.asmx?wsdl',array(trace=>1));

$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);


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"?>
<SourceName xsi:type="xsd:string">StudioSevaYoga</SourceName>
<Password xsi:type="xsd:string">********************</Password>
<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>


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 by nymets1104
Link to comment
Share on other sites

  • Solution

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.