In a new posting on Fractured Realities (weblog for Davey Shafik), he talks about some new web services scripts that he created to make life a little simpler.
After my recent bout with Crtx_SOAP_AutoDiscover, I decided to write Crtx_XML_WSDL_Parser (thats a mouthful isn't it?!). This little script is a mere 178 lines of code long and is capable of generating a PHP 5 and PEAR Coding Standards compatible code skeleton for a given WSDL file. It has been tested with output from Crtx_SOAP_AutoDiscover+Crtx_XML_WSDL, .NET-generated WSDL and various WSDL files from around the web (such as Amazon, Google, CapeScience stuff, and more).
I'm extremely pleased at how this turned out and I wonder why nobody did it before - frankly, it was easy. Although, the use of SimpleXML is what makes this so easy to do, I guess not having that in PHP 4 could be the reason. The only change I wish to make, is to use XPath instead of iterating through nodes to find what I want. There seems to be bugs in the SimpleXML XPath function though, beyond basic XPaths it is unable to find nodes.
Crtx_XML_WSDL_Parser is not slow by any means, considering the nature of the job it has to do. Only one WSDL file I came across took more than 1 second - most were in the 0.2-0.5s range
Now, if only he'd play nice and share with the rest of us...




