__soapCall() not working, but client->method() does?

tonyhyderabad

New Member
I am working on a project involve SOAPClient and up until now have been making method calls like this:\[code\]$responseObj = $this->client->method($parameterArray);\[/code\]It works great, but it results in a lot of code that is the same copied over and over again (specifically all the try/catch stuff). So, I thought it would be nice to make a function such as this:\[code\]makeAPICall($method, $parameters = null){ try { $responseObj = $this->client->__soapCall($method, $parameters); } catch (Exception $e) { // re-throw the exception. whoever made the initial call will handle it. throw new Exception($e->getMessage()); } return $responseObj;}\[/code\]For some reason this does not work, however. The exception I get has to do with parameters missing, even though I pass them as an array exactly as I did with my previous way of making the method calls.In addition to that, the following SOAP calls to get the XML no longer work (nothing is returned) when using the above function:\[code\]$this->client->__getLastRequest()$this->client->__getLastResponse()\[/code\]Any idea what I am doing wrong?
 
Top