Solved

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

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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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…
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 …

688 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