Solved

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

Posted on 2011-03-18
4
198 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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

763 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

6 Experts available now in Live!

Get 1:1 Help Now