Showing posts with label Code Generation. Show all posts
Showing posts with label Code Generation. Show all posts

WSF/PHP 1.2.2 & wsdl2php

Thursday, April 24, 2008

The enhancements done to wsdl2php tool to support as much schema constructs as possible is the key highlight of the upcoming WSO2 WSF/PHP 1.2.2 release.

One of the key limitations of the built in SOAP extension is the level of schema support. I have seen many users complaining on this on the PHP SOAP list.

The amount of schema coverage that you get with WSF/PHP also beats out NuSOAP WSDL support. We have done considerable amount of testing for a large number of WSDL files with various schema constructs for WSF/PHP.

I expect the wsdl2php tool be the killer tool that help solve all the problems that PHP users faced with WSDL.

How Code Generation Makes Development Easy Over Traditional WSDL Mode

Thursday, February 14, 2008

Yesterday Samisa's blog revealed new approach that WSF/PHP is going to take in the next major release.

WSF/PHP is going to introduce pre code generation for both Web Service clients and services for PHP developers. I think this may little strange to PHP people who used to expect things happening in run time. But sometime it s better to tests different paths to test and pick the ideal method.

I see several advantages in static code generation over current run-time support for the WSDL mode.
1. The usability is high,
Currently we should write classes manually in order build the data tree of the payload, For that you need to have at least some idea of WSDL and XML Schema. But we cannot expect an average user identify these types and write PHP Classes by hand. So it is better we have systems generating classes.

2. Low error-prone
If you have set of classes pre-defined to use in your system it will be no doubt less error-prone than using classes written by yourself. Because current way you may do errors both in writing classes and invoking services, so generated code will eliminate the errors in writing classes.

3. Rapid Development
It would give you some part of code written for you

4. Sample Demos
Easy to generate sample demos for a particular WSDL, so users will be able to follow them in their application

5. Performance,
If we can bypass the wsdl mode with the newer code generation approach that would enhance the performance, So surely in the first step the generated code would be mostly run using the current wsdl mode, so there will be no performance improvement.

6. Easiness in testing
Mostly this open the path to automate testing.

Code Generation for WSDL Mode

Wednesday, February 13, 2008

Both WSF/PHP and SOAP extension has WSDL modes. But none of them has the tools for generating code for a given WSDL. Because of this, the users are in hot water when it comes to implementing the complex type mappings for the request and handling response. If you make a simple mistake in SoapVar or SoapParam classes, debugging could take hours or even days before you get to know the problem.

To address this issue, WSF/PHP is coming up with a nice proposal. Implement code generation tool that can generate all complex type classes along with some demo code. So on one hand, you do not have to write the complex class mappings manually. And on the other hand, you will be provided with some sample code that would help you understand how to consume the service described by WSDL. WSF/PHP already have the model in place to implement the tool. It is only a matter of time before someone put all the pieces together and come up with the code generator.