JAX-WS 2.1 : First spin.

JAX-WS 2.1 is out.
Here is a blog entry that will give you all the details you need: see the Fast & Furious.
For me, it means it's time to give it a try and build some interface to PayPal Web services. The performance improvement seams to be worth a closer look.
In my current project, I have start to look at performance between different implementations for a given Business Process, and I am getting to the point were the interpretation of the performance number can be swinged either way, just with a few tweaks on my dataset.
Here is a tip I wanted to share with those that are trying to use SOAPElement --the JAX-RPC/SAAJ equivalent of the DOM Element-- when trying to work with large datagram that are handled as XML: Make sure you do not try to preserve whitespace. Otherwise, for every nested element you have (XMLElement) you will have an extra java object to carry the linefeed (an XMLText). It can add up very quick.

The key is on line 193, in the code folowing code snippet:

189 private SOAPElement getDocumentFromString(String xmlStream) {
190 SOAPElement res = null;
191 try {
192 DOMParser builder = new DOMParser();
193 builder.setPreserveWhitespace(false);
194 builder.parse(new StringReader(xmlStream));
195 res = SOAPUtil.toSOAPElement((Element)builder.getDocument().getDocumentElement());
196 } catch (Exception ex) {
197 ex.printStackTrace();
198 }
199 return res;
200 }


Popular posts from this blog

Changing the version of JDK used by JDeveloper

Connection reset from a WCF Web Service

Why ws-rx ?