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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:25:21+00:00 2026-05-30T02:25:21+00:00

I have a problem related to parsing a SOAP message. This is the message:

  • 0

I have a problem related to parsing a SOAP message.
This is the message:

------=_Part_3_5438437.1107262647279

Content-Type: text/xml

<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
  <soap-env:Body>
    <content>
     [...]
     </content>
  </soap-env:Body>
</soap-env:Envelope>

------=_Part_3_5438437.1107262647279
Content-Type: text/plain; charset=ISO-8859-1

text
------=_Part_3_5438437.1107262647279--

This is an extract of my Java servlet, which should receive and parse the message:

messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
message = messageFactory.createMessage(mimeHeaders, req.getInputStream());

To test the servlet, I’m using JMeter. I put the SOAP message in the raw post body of an HTTP Request.
In the header I put this:
Content-type multipart/related;boundary=—-=_Part_3_5438437.1107262647279

Problem number 1: it seems that the parsing in SAAJ is bugged, because debugging I see that boundary is seen as —-null, as if = can be used as a token and nothing more. So I removed it, both from the body and from the header. This is a huge problem, because I can’t change the input I receive, but let’s pretend I can for a while.
Ok, this moves me forward to problem number 2: now the boundary is parsed correctly, but I obtain this exception: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Bad Content-Type for SOAP Part : text/plain

Ok, I believe I know how to solve it, I have to add the type in Content-type header:
Content-type multipart/related;type=text/xml;boundary=—-_Part_3_5438437.1107262647279

Yes, but of course I have another nasty exception: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
at com.sun.xml.messaging.saaj.soap.MessageImpl.parseContentType(MessageImpl.java:337)

I’m using saaj-impl-1.3.18 and saaj-api-1.3.3.
java version “1.6.0_29”
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11D50b)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

  • 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-30T02:25:23+00:00Added an answer on May 30, 2026 at 2:25 am

    The solution to problem number 2 lies in the empty line here:

    ------=_Part_3_5438437.1107262647279
    
    Content-Type: text/xml
    

    It must go away, otherwise the content type is assumed to be text/plain by default.
    Thanks to Brian Joh http://twitter.com/brianwjoh for pointing this out.
    For problem number 1 I solved it simply by putting boundary value between “. The same apply for type.

     type="text/xml";boundary="----=_Part_3_5438437.1107262647279"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a serious performance problem. I have a database with (related to this
This is basically a math problem, but very programing related: if I have 1
I have to parse xml file and after parsing I have to out related
I have a problem related to graph. I am not a computer science grad
I have a problem related to the subset sum problem and am wondering if
I have a performance problem related to string comparison (in Java). I'm working on
I have a problem which I think is related to forward declarations, but perhaps
I have a problem related to timezone behaviour of a Rails 3.1.1 application. Here
I have this strange problem in JQuery. I try to set a value to
I have more of a 'problem solving' question than a syntax related problem. Briefly,

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.