Announcement Announcement Module
Collapse
No announcement yet.
Formatting JAXB2 output Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 ?

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
    
        <!-- SOAP Message Factory -->
        <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
            <property name="messageFactory">
                <bean class="com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"></bean>
            </property>
        </bean>
    
    <!-- Marshalling -->
        <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
            <property name="contextPath" value="org.epseelon.tagspot.schemas"/>
            <property name="marshallerProperties">
                <map>
                    <entry key="jaxb.formatted.output">
                        <value type="boolean">true</value>
                    </entry>
                </map>
            </property>
        </bean>
    <!--...-->
    </beans>

  • #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.

    Comment


    • #3
      Actually, it looks like your problem is really the other post you made...
      http://forum.springframework.org/showthread.php?t=49423

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

      Comment

      Working...
      X