File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes XSLT or handler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "XSLT or handler" Watch "XSLT or handler" New topic

XSLT or handler

nitin pokhriyal
Ranch Hand

Joined: May 19, 2005
Posts: 263

I was wondering what is best to use in order to change the incoming request? is it better to use XSLT or use handler to change the request?

Suppose i have Web service A which serves WebService B and WebService B serves C and E. C and E have different vocubulary which is handles by WebServices B in order to process request which understandable by WebService A. So my question is which is better to use XSLT or handlers.

for more clarity, suppose there is a verb which C calls "subtract" and E calls "minusops". which basically substracts two numbers passed in request.

For Example, below is intermediatary.

I don't know if i were able to make question clear enough. Please let me know i were not clear enough

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
Where would you insert the XSLT to change the incoming request?
I feel a handler is the obvious place to insert additional processing of in- and out-going requests because:
- The source code of the web service may not be available.
- Separation of concerns.
Separate the additional processing, which in some deployments may not be needed, and the service providing some business logic.
This makes the service more easily changeable.
In the handler, you can of course use XSLT to process messages!

Another approach is to make the service contracts of all services uniform - please refer to this very interesting presentation:
Best wishes!

My free books and tutorials:
nitin pokhriyal
Ranch Hand

Joined: May 19, 2005
Posts: 263
for xslt processing i can write a filter and apply that in web.xml to handle request. I will go through link.

thanks alot for reply.
Vinay Nath
Ranch Hand

Joined: Jul 06, 2008
Posts: 85
I agree with Ivan, the best way is to use handlers and in there you can perform transformations on the message.

The handlers fit the web service architecture better then filters. What if you have to implement web service as a session bean in future, then you will have to implement the filter's logic in an interceptor.
But if you use handler, it pretty much will remain same.

SCDJWS 5.0, SCBCD 5.0, SCWCD 5.0, SCJP 5.0
nitin pokhriyal
Ranch Hand

Joined: May 19, 2005
Posts: 263
ok. thank you guys
I agree. Here's the link:
subject: XSLT or handler
It's not a secret anymore!