Adventures in PHP, SOAP and WSDL

Sep
22
2006

So, this week I've been working heavily with PHP, consuming full-blown SOAP web services, which I had only dealt with casually in the past. The last time I used SOAP and PHP, I used NuSOAP, but, apparently, there's a namespace collision between NuSOAP and the new PHP SOAP library.

Given that this is for a client, and namespace collisions aren't likely to be won by 3rd party libraries, I'm using the included library from PHP5. However, that's all just background to my general surprise at just how primitive most of the tools in PHP are at dealing with SOAP. SOAP 1.1 was submitted as a standard back in 2000, 6 years ago.

For the basic stuff, it works well enough, but, when it came time to code a test server to work with until the real one was finished, I had to generate a WSDL file and discovered that I was pretty much stuck doing it manually. The library provides a way to construct a service *given* a WSDL file, but how you get it is up to you.

This isn't entirely unreasonable, since a WSDL needs strongly typed variables, which PHP doesn't do, but there's not even a mechanism to more explicitly cast variables and turn that into a WSDL.

Anyway, it turns out that someone put together a nice little tool for generating them, so you can keep up with Dotnet Jones next door and your SOAP services can have their very own WSDL's as well.

For a bonus game, read this post out loud to someone who doesn't do web development and take a picture of the look they give you.

 

Comments on this post

Feedback is always welcome. Read some from other folks or leave your own below. Just keep things civil and remember that what you post lives on in public. Forever.

Thanks,
J

Leave Your Own Comment

By submitting a comment, you agree to license it under the terms of the Creative Commons Attribution license.

© 2003-2008 J Wynia. All original content is licensed under the terms of the Creative Commons Attribution license unless otherwise noted. Content from other sources is licensed under its original terms.