Solved

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

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xampp tool 12 48
use lov values 2 49
Adding multiple JVM environments to RedHat 6 7 18
Java: anonymous class 4 17
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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 …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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…

786 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