Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Tracing XML request/responses with JAX-WS when error occurs

Posted on 2011-03-18
4
Medium Priority
?
269 Views
Last Modified: 2016-02-26
I want to log raw soap post requests if there are any errors , I am using JAX-WS. Any help will be appreciated.

Is there an easy way (aka: not using a proxy) to get access to the raw request/response XML for a webservice published with JAX-WS reference implementation (the one included in JDK 1.5 and better) only when exception occurs in response? I want to log raw SOAP reuest so that I can test it thorugh any webservice client at a later stage
0
Comment
Question by:pkseepathi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 35170501
As per i know they dont have any issues but depned upon ur code genral error  will coccur .

You pass as xml using xmlparser.jar and related thing
0
 
LVL 2

Accepted Solution

by:
astaplesnerd earned 2000 total points
ID: 38101111
You could implement a Filter that writes the request out to file as it is being read.

This could be accomplished by wrapping the HttpServletRequest that is passed on with an an implementation that returns an InputStream that is actually a TeeInputStream that writes to a FileOutputStream (or any other desired destination).

If you can detect an exception based on the http response code, then you could write the body of the request to a ByteArrayOutputStream (essentially to memory) and only log/write that to file if the actual http reponse code indicates an error.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For some reason Google Apps has decided to reserve 'www' for your new domain which results in an error when trying to map the web address 'www' to a certain site in your Google Sites. The error is 'this address is already being used' and after some …
The task of choosing a web design company to build a website for your business should never be taken in a light manner. Provided the fact that your website will act as a representative to your business and will be responsible for imposing an online …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This video teaches viewers about errors in exception handling.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question