PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I work at a company where we develop in PHP as well as .NET. I have written a simple web service in C# that I need to consume via PHP. The problem is that no matter how I return the data from C# whether a multi dimensional array, an array of objects, a .NET datatable type etc... PHP maps ALL of the xml to a single variable. I am trying to figure out how to get the different variables in the XML mapped to multiple variables into PHP which I can then traverse. Within PHP we are currently consuming coldfusion as well as other php web services without any problems. Seems that php doesn't like .NET for some reason. Here is the code I am using to generate the request using PHP 5.2:
Looks like I managed to paste the original response returned by the web service incorrectly, I have pasted the real returned response as well as edited th original:
Solved my own problem. My php.ini settings were caching WSDLs and i had originally tested the webservice returning back a single value. Once I changed the web service so that it was returning complex data php was still using the rules from the old WSDL. Turned off soap caching and it started working as expected.
Consuming .NET web services was a huge pain for me and my company as well. .NET generally doesn't play nicely with PHP, especially when passing the incredibly enormous datatable which, while highly useful inside .NET, is nearly an impenetrable fog when trying to parse it as a SOAP result in any other language. I'm working on a .NET communication layer which rests between a .NET web service and your PHP. Its turned into a pretty strong class - it parses datatable information (though I have to do an extra process to do datatype transformation, since PHP reads everything as a string) and is a fairly handy SOAP manager as well.
Unfortunately, my communication layer was produced on government time and I need permission from the state to release it as open source. Still waiting on that......