Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6163287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:48:06+00:00 2026-05-23T21:48:06+00:00

(Java 6, Spring 3, Spring-WS 2, JAXB2, Tomcat 6) I have a requirement to

  • 0

(Java 6, Spring 3, Spring-WS 2, JAXB2, Tomcat 6)

I have a requirement to log the request and response XML to a database table. I would like to be able to create a record on receipt of the request XML and update the same record when the response XML (or fault) is ready. Is there a way to do this with Spring-WS 2?

I want to wrap the invocation of the endpoint prior to unmarshalling the XML so I can save request XML, invoke the endpoint, and finally save response XML. I would use the unique ID returned from the DB after saving the request XML to identify the record that needs to be updated with the response XML.

All help is much appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:48:06+00:00Added an answer on May 23, 2026 at 9:48 pm

    You can use Spring-WS EndpointInterceptors.

    Implement an interceptor.

    You have to implement the org.springframework.ws.server.EndpointInterceptor interface where methods to act on the request and response events are provided.

    By accessing the MessageContext object, you can retrieve the request and response mesages (getRequest and getResponse methods).
    You can also use the setProperty method to store information in the request moment that is accessible in the response to correlate information (e.g., the ID of the record to update in the DB for example).

    Configure the interceptor.

    The interceptor either can be configured for a specific request or globally for all the web services. I copy some configuration from the documentation:

    <sws:interceptors>
     <bean class="samples.MyGlobalInterceptor"/>
    <sws:payloadRoot namespaceUri="http://www.example.com">
     <bean class="samples.MyPayloadRootInterceptor"/>
    </sws:payloadRoot>
     <sws:soapAction value="http://www.example.com/SoapAction">
      <bean class="samples.MySoapActionInterceptor1"/>
      <ref bean="mySoapActionInterceptor2"/>
     </sws:soapAction>
    </sws:interceptors>
    
    <bean id="mySoapActionInterceptor2" class="samples.MySoapActionInterceptor2"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to marshall Java objects into XML and vice-versa from within an
I'm following a tutorial to set up a skeleton application for tomcat : http://maestric.com/doc/java/spring/setup#build_files
Does Java and/or Spring have the concept of properties? I have bunch of domain
I am currently building an application using Tomcat, Spring and JAVA. I am using
I have a Java program that executes from Spring Qquartz every 20 seconds. Sometimes
I wonder if this is possible in jaxb2. I have a xml that can
I have this schema and i'm using JAXB to generate java stub files. <?xml
In Java, we work a lot with JAXB2. Object<->XML mappings are defined as annotations
I'm switching from Castor to JAXB2 to perform marshaling/unmarshaling between XML and Java object.
I have a number of XML schema that use JAXB (Java Architecture for XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.