Solved

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

Posted on 2011-03-18
4
216 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
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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

These instructions are based on installing Owncloud on your new raspberry pi connected with a usb HDD. What do you need Part A? A Raspberry Pi, model B. A boot SD card for the Raspberry Pi. A usb HDD An Ethernet cable to connect to the lo…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

864 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now