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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:00:26+00:00 2026-05-20T15:00:26+00:00

I have a JAX-WS endpoint with a number of methods that all return XML

  • 0

I have a JAX-WS endpoint with a number of methods that all return XML documents that are converted to a String.

This has been working fine on Sun Java System Application Server 9.1 Update 2 for some time, but needs to be deployed to a new server.

It was deployed to Glassfish 3.0.1 without any problem except one small issue.
Original Response example excerpt:

<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns2:getTransactionTypesResponse xmlns:ns2="http://myns.com.au/">
      <return xmlns="">&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;my_xml version="1.2" query_date=""&gt;
  &lt;add_transaction_type description="Contributions" name="Contribution" type="C"/&gt;
  &lt;add_transaction_type description="Transfer In" name="Xfr or R/O In" type="X"/&gt;
&lt;/my_xml&gt;
      </return>
    </ns2:getTransactionTypesResponse>
  </S:Body>
</S:Envelope>

On the new server it comes back as:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns2:getTransactionTypesResponse xmlns:ns2="http://myns.com.au/">
      <return>&lt;?xml version="1.0" encoding="UTF-8"?>

&lt;myxml version="1.2" query_date="">
  &lt;add_transaction_type description="Contributions" name="Contribution" type="C"/>
  &lt;add_transaction_type description="Administration Fee" name="Fee:AUM" type="U"/>
&lt;/my_xml>
      </return>
    </ns2:getTransactionTypesResponse>
  </S:Body>
</S:Envelope>

Almost exactly the same but only the opening angle brackets are escaped, not the closing brackets.

I have tested this using direct HTTP POST requests so I know it is not being mangled by any client code.

I upgraded the server again to Glassfish 3.1 thinking there was a problem with the included webservice libraries but with no luck. My application relies totally on the webservice support in glassfish – it does not include any of its own WS or XML libraries.

The endpoint is basically defined as follows:

@WebService
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL, parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
public class MyEndpoint {
  @WebMethod()
  public String getTransactionTypes() {
    return someMethodThatReturnsXmlString();
  }
}

I have been unable to find anyone else with this issue, except a reference from this poster who has observed it as a consumer of a service: Can I force JAXB not to convert " into &quot;, for example, when marshalling to XML?

This is a published service so I can’t rely on consumers being able to update their clients to handle this. Interestingly my existing testing interface using a generated Java client doesn’t seem bothered by it, but I can’t rely on this.

Has anyone encountered this and been able to solve it? Is there a way I can hook into the WS framework and do my own escaping as a workaround?

Thanks in advance.

  • 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-20T15:00:27+00:00Added an answer on May 20, 2026 at 3:00 pm

    From http://www.w3.org/TR/xml/#syntax, section 2.4

    The ampersand character (&) and the
    left angle bracket (<) must not appear
    in their literal form, except when
    used as markup delimiters, or within a
    comment, a processing instruction, or
    a CDATA section. If they are needed
    elsewhere, they must be escaped using
    either numeric character references or
    the strings ” & ” and ” < ”
    respectively. The right angle bracket
    (>) may be represented using the
    string ” > “, and must, for
    compatibility, be escaped using either
    ” > ” or a character reference when
    it appears in the string ” ]]> ” in
    content, when that string is not
    marking the end of a CDATA section.

    It states that the right angle bracket (>) may be escaped but does not have to be, so you should be fine.

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

Sidebar

Related Questions

I have a JAX-WS web service that has been running in a production environment
I have a JAX-WS WebService like this: public class ParentClass{ public String str1; }
In web.xml I have the following: <servlet> <description>JAX-WS endpoint - EARM</description> <display-name>jaxws-servlet</display-name> <servlet-name>jaxws-servlet</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSSpringServlet</servlet-class>
I have a JAX-RPC (Java) web service that needs to return a complex polymorphic
suppose i have a jax-rs resource class that looks like this: @Path(/nodes) public class
I have a JAX-RS 1.1 resource FooBar that has a method which accepts a
I have a jax-rpc web service. When i try to pass xml to the
Is it possible in jax-ws to have a webmethod that creates a new object
Have a matrix report now that has Position, Hours and Wages for a location
I have a JAX-RS resource, which gets its paramaters as a JSON string like

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.