Announcement Announcement Module
Collapse
No announcement yet.
JibxMarshaller: unmarshals request, but not marshals responce Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JibxMarshaller: unmarshals request, but not marshals responce

    I am using JiBX binding to marshal/unmarshal request and response messages. It woks fine for the incoming request - I am able to receive and extract the data on the server. However, the response sent back to the client is empty, i.e. no data is sent in SOAP body.

    Below is the configuration of my application:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans ...>
    
    	<bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
    		<property name="payloadCaching" value="false"/>
    	</bean>
    
    	<bean id="payloadMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
            <property name="endpointMap">
            	<map>
            		<entry key="{...}DudeRequest"
            			   value-ref="mateEndpoint"/>
            	</map>
            </property>
        </bean>
    
    	<bean id="mateEndpoint"
    		  class="com.springinaction.poker.webservice.MateMarshallingEndpoint">
    		<property name="marshaller" ref="marshaller"/>
    		<property name="unmarshaller" ref="unmarshaller"/>
    		<property name="dudeEvaluator" ref="dudeEvaluator"/>	
    	</bean>
    
    	<bean id="dudeEvaluator" class="com.springinaction.poker.DudeEvaluatorImpl"/>
    
    	<bean id="marshaller"
    		  class="org.springframework.oxm.jibx.JibxMarshaller">
    		<property name="targetClass" value="com.springinaction.poker.MateResponse"/>
    	</bean>
    	
    	<bean id="unmarshaller"
    		  class="org.springframework.oxm.jibx.JibxMarshaller">
    		<property name="targetClass" value="com.springinaction.poker.DudeRequest"/>
    	</bean>
    
        <bean id="mate" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
    		<property name="schema" ref="schema"/>
            <property name="portTypeName" value="Mate"/>
            <property name="locationUri" value="..."/>
        </bean>
        
    	<bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
    		<description>
                This bean definition contains the XSD schema.
            </description>
            <property name="xsd" value="/MateTypes.xsd"/>
        </bean>
    
    </beans>

    This is the request message:
    Code:
    POST /Poker-WS/services HTTP/1.1
    Accept-Encoding: gzip
    Content-Type: text/xml; charset="UTF-8"
    SOAPAction: ""
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Java/1.4.2
    Host: localhost:9080
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alive
    Content-Length: 284
    
    <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="..."><soapenv:Body><DudeRequest xmlns="..."><Dude><klik>boo</klik><realName>notboo</realName></Dude></DudeRequest></soapenv:Body></soapenv:Envelope>
    This is the response message:
    Code:
    HTTP/1.1 200 OK
    Server: WebSphere Application Server/5.1
    Content-Type: text/xml; charset=UTF-8
    SOAPAction: ""
    Content-Language: nl-NL
    Transfer-Encoding: chunked
    
    95
    <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="..."><soapenv:Body /></soapenv:Envelope>
    0
    As you can see the response message is empty. I am sure that the MateMarshallingEndpoint sends the MateResponse instance containing all the data on a return of the MateMarshallingEndpoint::invokeInternal(Object object) method.

    I have used xsd2jibx tool to generate all the JiBX binding artifacts.

    As you have also noticed I am using AxiomSoapMessageFactory to parse SOAP messages.

    ameremortal

  • #2
    i've solved the issue. the problem was not in the JiBX marshaler, but rather in AxiomSoapMessageFactory.

    the "payloadCaching" property on AxiomSoapMessageFactory was set to false, while it had to be true.

    thank you anyway

    Comment

    Working...
    X