[mashup-dev] Annotating JavaScript to make JavaScript Web services
Deployment easy
Thilina Gunarathne
thilina at wso2.com
Thu Mar 1 23:13:47 PST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
> It is very cool feature to have JS2WSDL support , and annotation will
> help to support that. What you just need to do is populate the
> AxisService correctly then at the run time you would get the right wsdl.
Yes.. That's our ultimate goal :).
>>> I have developed a small patch for Rhino which enable parsing the
>>> above special comments and mark the function as a WebMethod. Then it
>>> is possible to modify the JSDeployer written by Thilina in the
>>> following manner to identify WebMethods.
Cool.. Good Stuff.. Patching Rhino would be great for the start for our
POC as we discussed earlier.. But on the long run I doubt whether Rhino
people will accept this patch, since this will slow down the performance
of Rhino and also we are not implementing a defined annotations spec.
IMHO we might need to come up with a separate JavaScript annotations
parser, which we can use within the deployer. May be we can reuse the
rhino parser, but it'll also be quite trivial to write a new parser to
parse only these specific stuff. We can get some hints from this api.
http://au3.php.net/language.oop5.reflection
I'm wondering about the possibilities of writing this using javascript
it self. But the drawback in that case would be that we need to get the
help from Rhino at the deployment time to run it for us..
To extract the data from the annotation we can follow what is defined in
the PhP annotations. http://wso2.org/wiki/display/wsfphp/WSDL+Generation+API
Thanks,
Thilina
>>>
>>> Object[] ids = engine.getIds();
>>> for (int i = 0; i < ids.length; i++) {
>>> String method = (String) ids[i];
>>> Object object = engine.get(method, engine);
>>> - if(object instanceof Function){
>>> + if(object instanceof BaseFunction &&
>>> ((BaseFunction)object).isWebMethod()){
>>> AxisOperation axisOp = new InOutAxisOperation(new
>>> QName(method));
>>> axisOp.setMessageReceiver(new JavaScriptReceiver());
>>> axisOp.setStyle(WSDLConstants.STYLE_DOC);
>>> axisService.addOperation(axisOp);
>>> }
>>>
>>> }
>>>
>>> This patch can be extended to support the required annotations
>>> defined in JSR-181.
>>> Sameera
>>>
>>> _______________________________________________
>>> Mashup-dev mailing list
>>> Mashup-dev at wso2.org
>>> http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev
>>>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFF586rTt0cKycFPQgRAslqAJ409Qlcv64VH0LnzJgxzbTs5eznAACfZzX5
k9mvpkjG5dS8V0ogRqvWWK8=
=YLlc
-----END PGP SIGNATURE-----
More information about the Mashup-dev
mailing list