Jump to content

Soap Fault Details


DKP

Recommended Posts

I'm trying to use PHP to communicate w/ a web service via SOAP / HTTP. I was actually able to get this to work fairly quickly using the SoapClient class as show below. However, the service is storing some additional information in the "details" section of the SOAP fault, but I don't see from the docs how to get access to that data? The SoapFault constructor appears to take "details" as an argument, but is it possible to retrieve this information in PHP?

try {	$client = new SoapClient("my.wsdl");	$result = $client->func($params);}catch (SoapFault $fault) {	$code = $fault->faultcode;	$message = $fault->getMessage();}

Also is there a way to get access to the underlying XML from the SOAP message? This might be handy for debugging.

Link to comment
Share on other sites

Yes, I read this page, but it says nothing about the "details" section of the soap fault. I've dumped the contents of every documented public method and I still cannot find the data. The constructor has a "$details" argument, which I'm assuming is what I'm looking for. What public variable does that data get stored in, or what method can I use to access it?

Link to comment
Share on other sites

This is how it shows the constructor for the SoapFault class:__construct ( string $faultcode , string $faultstring [, string $faultactor [, string $detail [, string $faultname [, string $headerfault ]]]] )It shows 4 properties listed on that page, plus a couple methods like toString that may have what you want. I would probably check the message property first. If you use var_dump with the object it will list what's in each property, there may be undocumented properties.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...