|
|
||
Vivek Pandey's BlogCommunity: Java Web Services and XML ArchivesWhat's up with Scripting support on Glassfish?Posted by vivekp on January 26, 2008 at 10:04 PM | Permalink | Comments (6)Scripting is becoming ever popular among web application developers. Glassfish already supports Ruby on Rails with JRuby, Phobos brings in solid support for JavaScript on Glassfish and AJAX framework jMaki and all of these with excellent NetBeans tooling. There are other scripting languages such as PHP and Python, which are very popular among developers too. How nice would it be to deploy your PHP or Python based web applications on Glassfish? Well, we know that marrying Java and scripting languages has it's own challenges. JSR-223 let you execute dynamic languages from inside Java. However the interpreters for such languages are written in Java and generate bytecodes and at runtime deal with all the dynamic types and method dispatching and what not. This is because JVM is designed to be used for statically typed language such as Java where you know the types at the compile time and to take care of types at the runtime the dynamic language interpreters use complex mechanism, which results in to uses of more memory, performance etc. JRuby overcomes these by doing JIT ahead of time, but then this poses limitation specially on the server side considering Rails which is single threaded. The good news is that there are efforts in place in JVM to support Dynamic Languages, such as JSR -292 is going to add a new bytecode, invokedynamic, that supports efficient and flexible execution of method invocations in the absence of static type information. There is also a new project Da Vinci Machine that is going to bring in support for dynamic languages (or any other language) to JVM. You might wonder why I am talking about all the scripting stuff! Well, I have taken up the role of Scripting Lead in Glassfish. I will ensure that Glassfish is home to many of the popular scripting languages out there and in fact will try to bring best of both worlds to Glassfish. JAX-WS will be lead by very capable Jitu. I am working on wrapping up implementing some new features for upcoming Metro 1.2 or JAX-WS RI 2.1.4 and starting to take on Scripting Lead. Stay tuned, you will be hearing more form me in coming days... Webservices in JDK 6Posted by vivekp on December 12, 2006 at 05:33 PM | Permalink | Comments (24)
Web service EndpointLets start with a POJO annotated with @WebService annotation. This annotation tells JAXWS that its a Web Service endpoint. You may like to annotate the methods that will be exposed as web services method with @WebMethod annotation. You dont need to specify it if all the methods will be exposed as web services method.
Now you need to do 2 things to build and publish this endpoint:
Thats it! You have deployed your web services endpoint. Now, try accessing
the deployed WSDL by typing Web Services ClientLets see how we develop a client based on proxy. Run wsimportYou would run wsimport on the deployed WSDL URL: wsimport -p client -keep This step will generates and compile some classes. Notice -keep switch, you need it to keep the generated Java source files. By default wsimport only leaves behind the compiled class files. In this example the classes that matters are
Invoke the endpointCalculatorApp.java
Now that you have your client code is ready simply compile it:
javac -cp . CalculatorApp.java
and run:
java -cp . client.CalculatorAppIt will print: Sum of 10+20 = 30 Running latest JAXWS RI on JDK6The obvious question might be that how would you use latest JAXWS 2.1 RI on top of JDK6. JAXWS 2.1 RI is feature complete and we are busy fixing bug. For list of JAXWS 2.1 features and plan refer to the JAXWS 2.1 roadmap. All you need to do is to use Endorsed Directory Mechanism to point to the lib directory in JAXWS intallation: Runtime
Tools
Use JDK 6 to develop your web services application and continue providing feedback to users@jax-ws.dev.java.net and if you find an issue report them at IssueTracker. JAXWS 2.0.1 M1 is out!Posted by vivekp on August 17, 2006 at 10:34 AM | Permalink | Comments (0)JAXWS 2.0.1 M1, a.k.a. re-architected JAXWS 2.0 RI is out! These bits are also delivered with the Glassfish 9.1 v2. So you can get all the improvements we made in JAXWS 2.0.1 right from this glassfish download. JAXWS 2.0.1 M1 is significantly modified since JAXWS 2.0 FCS. So what does this re-architecture brings in: PerformancePerformance boost - 70% compared to JAXWS 2.0 FCS. See Sameer's blog for the details on JAXWS 2.0.1 M1 performance. Here is what we did to boost performance:
PluggabilityBased on abstractions - Message and Pipe. WSIT components use this pluggable architecture to enable WS-Security, WS-Trust, WS-Relaible Messaging, WS-Addressing, etc. A typical pipeline on the client side would look like:
Similarly a server pipeline would look like:
The Pipe line is assembled based on the binding, handler or policy assertions. WSIT components use this pluggable architecture to enable WS-Security, WS-Trust, WS-Relaible Messaging, WS-Addressing, WS-Policy, WS-MetadataExchange etc. See Jitu's blog on JAXWS transports which are written as Pipe. JAXWS 2.0.1 M1 is feature complete with respect to the previous JAXWS 2.0 FCS release. We have run all the JAXWS 2.0 FCS SQE and TCK tests and found more than 90% of tests passing. So its stable but there are still few open P3 bugs. Download Glassfish 9.1 v2 thats released today, it has JAXWS 2.0.1 M1 bits in it. See Carla's blog on this release. So try out and send us your feedback. You can also download JAXWS 2.0.1M1 directly from java.net and tryout with other servlet containers as well. Checkout the doucmentation for details. More on JAXWS and WSIT MTOM interoperability ...Posted by vivekp on May 18, 2006 at 08:18 AM | Permalink | Comments (0)So what that extra interoperability MTOM feature in JAXWS 2.0.1 EA will bring in when used with or without WSIT?
Checkout jaxws and wsit projects and stay tuned... MTOM and WSITPosted by vivekp on May 16, 2006 at 08:01 PM | Permalink | Comments (0)JAXWS RI 2.0 FCS was released last week and we are working on JAXWS 2.0.1 EA. JAXWS 2.0.1 EA is re-architected for better performance and to a greater extent a pluggable architecture that allows WSIT components such as WS-Policy, WS-Reliable Messaging etc. to plug-in both at runtime and tool time. Checkout WSIT project on java.net. Read more info on WSIT is here. As part of this rearchitecture work MTOM implementation in JAXWS 2.0.1 EA is overhauled, re-architected and written form scratch. Feature wise its going to be the same as JAXWS RI 2.0 FCS but will be faster and more interoperable. Here are some of the key aspects of these changes:
I have BOF at Java One on 16th night where I will be talking about the MTOM implementation gory details and I will be happy to meet anyone interested in person and answer any question. MTOM in JAXWS RI 2.0 FinalPosted by vivekp on May 12, 2006 at 07:25 PM | Permalink | Comments (5)JAXWS 2.0 RI Final or FCS version is out with a well tested MTOM support. Functionality wise its same as the EA3 release but has some very important bug fixes. There are several bug fixes related to MTOM but I would like to mention couple of important ones:
Santiago has done some MTOM performance analysis and has a blog on it. For smaller data sizes MTOM and XML almost perform the same however you start seeing the performance benefits above 5-6KB. There is MTOM user document and sample that you can get from jaxws. So go and try it out and send your feedback to the dev alias. JAXWS 2.0 FCS is also also delivered as part of Sun Java System Application Server PE 9 included in the Java EE 5 SDK. Check Carla's blog on the Sun Java System Application Server PE9. | ||
|
|