Creating interoperable web services in multiple langages is a pain, and this utility intends to make it an easier task. Taking a simple pseudocode class and method definition as input it generates WSDL for a fairly standard web service. My plan is to also eventually generate the source code for implementing the client and server sides of the web service in various languages. The first language will be PHP (using the uni_soap library) as writing the web service interface in PHP is rather time consuming for all but the most trivial service definitions. I shall probably tackle Java next, as that seems to be the language used for the services with most interoperability issues.
The WSDL generated by ws_gen should be very standards compliant - I am using the WS-I testing tools frequently during development to test my WSDL, and my intention is that it should not be possible to generate a SOAP service that doesn't comply to WS-I standards using this tool. Currently the output is WSDL for SOAP 1.1, however I also intend to make it possible to generate code for XML-RPC web services.
The pseudocode language (WSGI) is currently sufficent for many web service applications, however a few additions are really needed. A new keyword nullable will probably be added soon, as will a limited form of templates for arrays, which will indicate appropriate storage classes. An example would be kvPair<string, myClass> instance; which would indicate a hash array of keys (of type string) and values (of type myClass). Inheritance, and abstract classes will also be added eventually, as will a method for indicating embeded or linked files and documents. Support for SOAP headers is also planned, though that is likely to be pushing the boundaries of the "always interoperable" intension of the code generator and pseudo code language.
The input language is very simple - there are only two keywords, and a few
simple inbuilt types (from XML Schema) so far.
I will document this eventually, but for now the language is so simple that
it should be fairly obvious what it can do just from looking at this example
code and my test examples.
A fairly minimal service definition would be -
webservice testService("http://www.nbsoftware.com/schema/test")
{
string methodOne(int i1, float i2, int[] i3, string i4);
m2Return methodTwo(myStruct);
}
class m2Return
{
int a;
string[] b;
}
class myStruct
{
nvPair abc;
string[] def;
}
class nvPair
{
string name;
string value;
}
The keywords are webservice and class, the main types are int, string, float and anyUrl.