PHP and Web Services – essential reading

An old web service implemented in PHP have been giving me some headache the last couple of days. Especially interoperability with clients implemented in other languages (like .NET) are troublesome. It seems to me that PHP is very forgiving. Which is good – sometimes – but not always. PHP let you get away with a lot when creating your web services. So just because your PHP client play along nicely doesn’t mean other clients will work. Far from it.

So after loads of googling I came to realise that even though 2010 is just around the corner there are still very few quality articles on PHP and web services/SOAP available. Most of the stuff I find is rubbish where people who don’t know nothing explain things they don’t understand.

So even though these articles below are old, they will give most people a very good grasp on how, and why, to create a SOAP web service using PHP that will work. (And a very short advice; use document/literal style for better interoperability with for example .NET and don’t use preserved words like “ref” as parameter (message parts) names for better interoperability with for example .NET).

  1. Which style of WSDL should I use?
  2. PHP SOAP Extension

A comment about the second article is in place though. I generally tend to favour mapping WSDL defined operations to methods in a class. So instead of using PHP methods like $server->addFunction(), use $server->setClass(). More on setClass() in the manual.

PHP

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

6 Responses to “PHP and Web Services – essential reading”

Trackbacks

Check out what others are saying about this post...
  1. [...] Lundqvist has a quick new post with pointers to two articles that’re good resources for getting you started with web [...]



Leave Comment

(required)

(required)