Showing posts with label WSF/Jython. Show all posts
Showing posts with label WSF/Jython. Show all posts

Sunday, August 16, 2009

GSoC: Experience

This was my second consecutive year as a Google Summer of Code student. During past 3 months I learned a lot of things. I discussed these in an earlier posts. In a nutshell;

1) I worked with a mentor (Matt Boersma) from a different time zone. This was the first time that I worked with a mentor from a different timezone. Our time difference was nearly 12 hours. We preferred email over chat since it was more conveinent for us.

2) It was a privilege to work as a summer of code student for Python Software Foundation (PSF). All the people who were mentoring me helped me a lot, ranging from shaping up the application (project proposal) to development.

3)It was a greatopportunity for me to work with experienced developers.

I would like to take this opportunity to thank my mentor Matt Boersma and Jython community for helping me to make my project a success. I would also take this opportunity to thank my co-mentors Jim Baker and Frank Wierzbicki.

I would like to state that it was a privilege and a honor to be selected as a GSoC student for a second time and thank Google for organizing a program like this. I am looking forward to participating in next year's GSoC as a mentor. :)

Saturday, August 15, 2009

GSoC: Update

During the development phase, I came across some problems. This is a follow up to my earlier posts. You can have a look at them here.

1) One problem is the way the API is designed to define the XML payload. I designed the WSF/Jython API in such a way that it is comparable with the WSF/Ruby implementation. Therefore WSF/Jython API should adhere to the API specified by WSF/Ruby.

When generating code using Axis2's code generation framework, you should generate it in a such a way that it should support XML object model(preferably in the case of axis2 - apache axiom). Therefore it would be better if the API supported axiom, inorder to use the code generation part. Consider the following example.

from org.wso2.wsf.jython.jythonwsclient import *

req_payload_string = "<deduct><var1>1.8</var1><var2>4.87594</var2></deduct>"
LOG_FILE_NAME = "/home/heshan/IdeaProjects/MRclient/src/python_client.log"
END_POINT = "http://localhost:8070/axis2/services/annotationScript/deduct"

try:
client = WSClient({}, LOG_FILE_NAME)
req_message = WSMessage(req_payload_string, {"to" :END_POINT})
print " Sending OM : " , req_payload_string
res_message = client.request(req_message)
print " Response Message: " , res_message

except WSFault, e:
e.printStackTrace();

In above code snippet, the payload is set as a string. i.e.

req_payload_string = "<deduct><var1>1.8</var1><var2>4.87594</var2></deduct>"

What should be done is to keep the above feature intact with the API and do a feature addition that will support Apache Axiom.

2) Therefore, the existing WSF/Jython codebase should be modified to support axiom for Jython (should look into this further).

3) Modify the existing codebase to include the code generation part. Having said that there should be more work done to seamlessly integrate this(code-generation part) to WSF/Jython code. More coding have to be done on code generation module for Jython.

4) In a earlier post I said of modifying the Python deployer to support Contract First approach. This happens in the server-side code generation. It's a problem that I am still having.

5) In the same post I said that
0nly generate the client code and use the existing WSF/Jython's client API. Then before running the client code you can add the WSF/Jython client-side jar to the class path.
Now it seems like the best option out of the two options mentioned in the above post.

[The above arguments are my opinions and may subject to change.]

Friday, July 10, 2009

GSoC: How to integrate with existing code base

This post will contain my arguments on "How to integrate this project to the existing WSF/Jython code base". This is a followup to my last post.

1. Modify the Python deployer to support Contract First approach.

2. To support Contract First approach you need to be able to generate a skeleton and a message receiver for your service. The generic message receiver that I have already written may not work because it works only on a limited schema structure.

3. Another way to look at the above argument(2) may be; only generate the client code and use the existing WSF/Jython's client API. Then before running the client code you can add the WSF/Jython client-side jar to the class path.

The above arguments are my opinion(for now) on integrating the gsoc code to existing code base. The above arguments may subject to change.

Sunday, July 5, 2009

GSOC: Problems faced during development

Earlier I said that I would be writing a blog post on the problems which I encountered during the development phase of my GSoC project. Here I am compiling them to a list. Some points in the list may not directly be problems but important things which came across during the process.

1. Had a problem with building axis2. This was overcome when I found a workaround for this. (This was a hard issue to regenerate because this will only happen occasionally.)

2. There were lot of dependencies inside axis2's code generation framework. Some dependencies were not set by the build script. Therefore had to manually add the dependencies and run the code. When it gives a compilation error stating a dependency is not there, had to set the dependencies. This took some time :).

3. Had to take some time to understand the existing code base and the architecture of the code generation framework.

4. Learned to work with XSLTs.

5. Another important point to note is that the WSF/Jython distribution, now needs some additional libraries to successfully run. You may have wondered "why is this happening?". As you may already know WSF/Jython is built on top of Apache Axis2. The new releases of Axis2 are having more dependencies towards other liblaries/jars (eg. wsdl4j, etc). Since I no longer work for WSO2, I do not have the access writes to change the build script for WSF/Jython. As soon as I get there, I would remember to revise the build script. Until then you could do a small workaround:)

Download Axis2 standard binary distribution. Then extract it. Add the jars which are residing in the lib folder, to the classpath. Then you could carry on with your work.

6. How to integrate this project to the existing WSF/Jython development. (I will present my arguments on this on a new post)


Thursday, September 18, 2008

WSO2 WSF/Jython 1.0-alpha


WSO2 WSF/Jython provides an amazingly simple approach to create (Code First) and consume Web Services in Jython. This framework integrates the Apache Axis2 web services engine into Jython. Thus, providing all the power and versatility of the Axis2 engine to the Jython user. Now, with just a few lines of code, Jython users can enjoy the benefits of Service Oriented Architecture using Web Services in their applications.

Web Service clients written using WSF/Jython framework could invoke enterprise web services which require WS-Security. Sending binary attachments as MTOM is also supported.

WSO2 WSF/Jython is released under the Apache License v2.0.

There are two packages that comes with this release, the server side and the client side.

Client Side Features

  • Support for invoking Web Services in a simple clean manner

  • Ability to use WS-Addressing when invoking services

  • Ability to invoke services which require WS-Security

  • Ability to send binary attachments using MTOM

Server side Features

  • Support for exposing services written in Jython

  • DataBinding support using a simple annotation mechanism

  • Automated WSDL generation

  • Ability to expose all enterprise features of Axis2 to services written in Jython

Articles

http://wso2.org/library/invoking-enterprise-web-services-using-jython

http://wso2.org/library/articles/deploying-python-service-axis2

Reporting Problems

Issues can be reported using the public JIRA at http://wso2.org/jira/browse/WSFJython

Contact us

WSO2 WSF/Jython developers can be contacted via the mailing list wsf-java-dev@wso2.org
To subscribe please send a message to wsf-java-dev-request@wso2.org

WSO2 WSF/Jython user mailing list is wsf-jython-user@wso2.org
To subscribe please send a message to wsf-jython-user-request@wso2.org

Alternatively, questions can also be raised in the forums: http://wso2.org/forum/797

Thank you for your interest in WSO2 WSF/Jython

Wednesday, September 17, 2008

Deploying a Python Service on Axis2

Apache Axis2/Java, is a popular open source Web service engine. It currently supports exposing services written in Java, Javascript and Ruby as Web services. This article discusses the Python data Binding that enable exposing Web services written in Python.

Axis2/Java is now able to expose a service written Python as a Web service. The underlying deployer will read the annotations and perform data-binding, schema generation. Schema generated will be passed on to the Axis2 engine, which will then perform the WSDL generation. Thereafter, a client is able to invoke the service using the WSDL generated.

Invoking Enterprise Web Services using Jython

This article discusses the usage of WSO2 WSF/Jython API to write Web service clients in Jython. WSF/Jython's Jython-Client API can be used to write a Jython service clients. It supports attachments with MTOM, SOAP, REST and WS-* standards such as WS-Addressing, WS-Security.

Tuesday, September 16, 2008

Jython Web Services with Axis2 - WSO2 WSF/Jython 1.0 alpha release

WSO2 Web Services Framework for Jython (WSO2 WSF/Jython), is an open source framework for exposing and consuming enterprise level Web Services in Jython.

You can download the source and binary distributions from the following URL.
http://wso2.org/projects/wsf/jython

You can read the following articles.
http://wso2.org/library/articles/deploying-python-service-axis2
http://wso2.org/library/invoking-enterprise-web-services-using-jython

Pleas feel free to send any feedback to our forum.
http://wso2.org/forum/797

For further details please visit our project's website at:
http://wso2.org/projects/wsf/jython

Thursday, September 4, 2008

My Presentation @ WSO2 - WSF/Jython

Every week we are having an Internal Presentation at WSO2. This week I did a presentation on the project I worked on during my internship with WSO2 - WSF/Jython.This framework helps to expose python scripts as web services through the Python Deployer and write service clients using the WSF/Jython API. I am planning to do a WSO2 WSF/Jython release by next week. I have written some articles to OT on using this API. The articles will be published with the release as well. Therefore I am looking foreward to next week. :)
WSO2 WSF/Jython
View SlideShare presentation or Upload your own.