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 7917277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:05:25+00:00 2026-06-03T15:05:25+00:00

I am building a Web service using Java and Spring-ws. It is working fine,

  • 0

I am building a Web service using Java and Spring-ws. It is working fine, except for one thing.

When I assembly the payload to be put inside the SOAP Body, I want to include CDATA escaped strings. This is how I want the result to look like:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:_0="http://example.com/ns">
<soapenv:Header/>
<soapenv:Body>
 <_0:Message>
    <_0:StringPayload><![CDATA[<myxml>stuff</myxml>]]></_0:StringPayload>
 </_0:Message>
</soapenv:Body>
</soapenv:Envelope>

However, Spring-WS seems to tamper with the payload when it adds the SOAP envelope. This is the result I get:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:_0="http://example.com/ns">
<soapenv:Header/>
<soapenv:Body>
 <_0:Message>
    <_0:StringPayload>&lt;myxml>stuff&lt;/myxml></StringPayload>
 </_0:Message>
</soapenv:Body>
</soapenv:Envelope>

Is there a way to make sure Spring WS does not escape XML characters and respect the CDATA tag?

I am using Spring WS together with Apache Camel, so a solution where I do not have to alter/extend the spring-ws classes would be prefered.

  • 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-06-03T15:05:28+00:00Added an answer on June 3, 2026 at 3:05 pm

    I have used MOXy and @XmlCDATA annotation to generate CDATA content, and experiments have shown that AxiomSoapMessageFactory reaplces it with escaped XML content (although Jaxb2Marshaller seems to produce correct CDATA stuff).

    However, it works just fine with SaajSoapMessageFactory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on building a web service (using c#) and this web service
I'm building a web service client using vb .net. The web service is secured
I am building a web service using the Zend Framework. I am using the
I'm building a JAX-RS web service (Jersey) and now I'm trying to start using
I am currently building a java-servlet-based web application that should offer its service to
Ive been trying to get an example Web Service working using SpringWS and Tomcat5.5
Almost every new Java-web-project is using a modern MVC-framework such as Struts or Spring
I am building a Web service using WCF as a way to provide access
I am building a web service using php core SOAP classes, and need to
I'm building a RESTful web service using Jersey that relies on MongoDB for persistence.

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.