SOAP Request Generates 500 with Nothing in the Apache or PHP Log

ELISHA CUTHBERT

ELISHA CUTHBERT

I ran into an odd error to track down. I’ll start off with the fact that I’m not a Soap expert, so this is probably obvious to someone who’s worked with Soap more than myself, but regardless, here’s what happened.

I’m setting a new Soap web service, but for some reason I kept getting a 500 http error every time I sent a request through. It was working before, then it stopped working. There was nothing in the error logs indicating what is causing the error.

127.0.0.1 - - [29/Feb/2016:09:58:05 -0500] "POST /SoapServer/index.php HTTP/1.1" 500 572 "-" "-"

I figured it was something to do with the XML being invalid, so I tried a different XML and it worked. Hmmm, what’s the difference between the two? It was a namespace issue.

In my WSDL, the targetNamespace was set to something like this http://www.example.com/Soap/Server/

But in the XML that was failing, the namespace was set to

xmlns:ns3="http://www.example.com/SomethingDifferent/"

That namespace ns3 referred to the actual Soap request portion of the XML document and it needs to match the targetNamespace. Once I synched those two up, I was back in business.

Soap is cool, but it can be a real pain in the arse to troubleshoot. There should be, and possibly there is a way to flip some switches on PHP’s SoapServer to log errors for this sort of issue.

The above photos are of Elisha Cuthbert. Cuthbert is a Canadian actress. Born in 1982, Cuthbert played Kim Bauer alongside Keifer Sutherland in the TV series “24.” I thought she was pretty funny in the TV show “Happy Endings.” I was bummed when ABC canceled it after just three seasons. Cuthbert apparently only dated NHL hockey players and is married to Dion Phaneuf – a defenceman for the Ottawa Senators.

Share Button

Leave a Reply

Your email address will not be published.