Recipe 15.4. Generating WSDL Automatically


15.4.1. Problem

You want to expose a set of methods via a SOAP web service. You want to automatically generate a WSDL file that describes this service.

15.4.2. Solution

The ext/soap extension does not support WSDL generation. However, there are a few other PHP scripts that you can use.

15.4.3. Discussion

Given the nature of SOAP, it's vital to provide clients with a WSDL file they can use to configure themselves for your server. Unfortunately, ext/soap does not support WSDL generation.

Therefore, you must either generate WSDL by hand from scratch, modify an existing document that supports a similar set of operations, or use an unofficial script, such as:


WSDL_Gen, by George Schlossnagle

http://www.schlossnagle.org/~george/blog/index.php?/archives/234-WSDLGeneration.html


wsdl-writer, by Katy Coe based on code by David Griffin

http://www.djkaty.com/drupal/php-wsdl


Web service helper, by David Kingma

http://jool.nl/new/

None of these scripts supports the entire SOAP and WSDL specifications, and each one uses a slightly different syntax to accomplish its goal. You should investigate all of them to see if they do what you need and fit your programming styles.

15.4.4. See Also

The WSDL specification at http://www.w3.org/TR/wsdl.




PHP Cookbook, 2nd Edition
PHP Cookbook: Solutions and Examples for PHP Programmers
ISBN: 0596101015
EAN: 2147483647
Year: 2006
Pages: 445

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net