Announcement Announcement Module
No announcement yet.
Formatting JAXB2 output Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Formatting JAXB2 output

    I have several issues with the responses sent back by Spring WS to my client. It's a J2ME JSR172 client and it seems to have a hard time parsing the response message ("Missing end tag for SOAP body or envelope"). One of the differences between the response sent by Spring WS and the request sent by my mobile client is that the response seems to be one single line.

    I've tried to add a property to my JAXB2 marshaller to format the output but I still see one single line in the response intercepted by Etherreal.

    Knowing that I'm using the following configuration, what should I add to format the output correctly ?

    <beans xmlns="" xmlns:xsi=""
        <!-- SOAP Message Factory -->
        <bean id="messageFactory" class="">
            <property name="messageFactory">
                <bean class="com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"></bean>
    <!-- Marshalling -->
        <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
            <property name="contextPath" value="org.epseelon.tagspot.schemas"/>
            <property name="marshallerProperties">
                    <entry key="jaxb.formatted.output">
                        <value type="boolean">true</value>

  • #2
    I would sincerely hope that formatting isn't the problem. You already have the tools to intercept the response; I'd start there. Grab that response and paste it into your IDE or something and have it formatted there so you can read it.

    If the response is fine, and formatting does turn out to be the solution. You should definitely look into getting a different parser on the client. A parser that can't handle a single-line response is probably going to be pretty problematic in the long run.


    • #3
      Actually, it looks like your problem is really the other post you made...

      It seems your nokia parser doesn't like them empty soap header. I think you've made two posts on the same issue really.