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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:59:55+00:00 2026-05-22T15:59:55+00:00

I have a SOAP web service written in java communicating via XML-utf-8. My produced

  • 0

I have a SOAP web service written in java communicating via XML-utf-8.

My produced xml’s attributes values should contain html and/or normal text with extra characters, so is that a good practise/or needed for safety to have my xml values encoded before I start constructing my xml?

something like this for every value in my entity classes? or another opinion?

String encodedString = URLEncoder.encode(s, "UTF-8");

and for the client:

ByteArrayInputStream stream = new ByteArrayInputStream(
            response.getBytes("UTF-8"));
    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build(stream);
  • 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-22T15:59:55+00:00Added an answer on May 22, 2026 at 3:59 pm

    My produced xml’s attributes values should contain html and/or normal text with extra characters, so is that a good practise/or needed for safety to have my xml values encoded before I start constructing my xml?

    It entirely depends on what you are using to create the XML:

    • If you are creating a DOM and serializing it, then you don’t need to encode attribute values beforehand.

    • If you are using a web services framework or XStream or something like that, then you probably don’t need to encode attribute values beforehand.

    • If you are creating the XML by concatenating Strings, then you DO need to encode the attributes.

    “Good practice” doesn’t come into it. If you need to do it, you do it. Otherwise you must not do it.

    The same arguments apply when you come to read / parse the XML at the other end.


    The bottom line is that there is no general answer. You need to understand the specific requirements of the middleware technology that you are using. The javadocs and other API documentation / tutorials are the first place to look for answers.

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

Sidebar

Related Questions

Hi I have a soap web service(java, spring, tomcat) In my web.xml file i
I have an application that connects via https to a SOAP-based web service that
I have a web-service written in Java, hosted on an Axis2 / Tomcat /
I have written a java axis2 1.4.1 web service and .net 3.5 WCF client
I have a SOAP based Web Service which returns back an XML response. I
I have been studying SOAP and WSDL in preparation for implementing a web service.
I am writing a C# client that calls a web service written in Java
I have a PHP SOAP web service, using CakePHP, which is returning a variable
I have an MVC 3 web app that calls a SOAP web service to
We have SOAP web services in production that are relying on SOAP Headers (containing

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.