Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-407

Spring-WS application using AxiomSoapMessageFactory and CastorMarshaller

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.5.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows Vista, Java SE 5, Maven

      Description

      Hello,

      It seem that this issue is allready fixed, but i still encounter it. My webservice application is developped following the Spring-WS 1.5.4 and using Axiom 1.2.7 with CastorMarshaller 1.2.
      The problem is when i call my web service server through a web client, the request is sent very well and treated. But the response is not sent back as i expected. I receive nothing in return.

      Can somebody help me, thanks in advance.

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I am afraid I am going to need some more information than this. What does your endpoint look like and how is it configured?

        Show
        arjen.poutsma Arjen Poutsma added a comment - I am afraid I am going to need some more information than this. What does your endpoint look like and how is it configured?
        Hide
        atohoun Aristide Tohoun added a comment -

        My End point looks like this :

        package digit.endpoint;

        import java.util.List;

        import org.apache.log4j.Logger;
        import org.springframework.ws.context.MessageContext;
        import org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint;

        import digit.schema.Equipment;
        import digit.schema.GetEquipmentsRequest;
        import digit.schema.GetEquipmentsResponse;
        import digit.service.DigitService;
        import digit.utils.ObjectUtil;

        public class DigitEndpoint extends AbstractMarshallingPayloadEndpoint {

        private static Logger logger = Logger.getLogger(DigitEndpoint.class);

        private DigitService digitService;

        public DigitService getDigitService()

        { return digitService; }

        public void setDigitService(DigitService digitService)

        { this.digitService = digitService; }

        @Override
        protected Object invokeInternal(Object arg0) throws Exception {
        logger.info(" ---------------- Begin of invokeInternal -------------------------");
        if(arg0 == null)

        { logger.fatal(" The request object is null"); throw new NullPointerException(" The request object is null "); }

        // get the request object ( i can verify that this is get very well )
        GetEquipmentsRequest request = (GetEquipmentsRequest)arg0;
        String idEq = request.getId();

        // call of my service implementation ( i can verify that this is fine)
        List<Equipment> listEq = digitService.getEquipments();
        Equipment[] equipments = new Equipment[listEq.size()];

        // supplying the response (the problem with Axiom occurs here. The return object is built but nothing is not sent back.)
        // I precise that this problem does not occur with SAAJ
        GetEquipmentsResponse response = new GetEquipmentsResponse();
        response.setEquipment(listEq.toArray(equipments));
        logger.info(" ---------------- End of invokeInternal -------------------------");
        return response;
        }
        }

        And its configuration is :

        <bean id="digitEndpoint" class="digit.endpoint.DigitEndpoint">
        <property name="marshaller" ref="marshaller" />
        <property name="unmarshaller" ref="marshaller" />
        <property name="digitService"><ref bean="digitServiceImpl"/></property>
        </bean>

        <bean id="marshaller" class="org.springframework.oxm.castor.CastorMarshaller">
        <property name="mappingLocation" value="classpath:mapping.xml" />
        </bean>

        <bean id="digitServiceImpl" class="digit.service.DigitServiceImpl">
        <property name="digitManager"><ref bean="equipementManager"/></property>
        </bean>

        Show
        atohoun Aristide Tohoun added a comment - My End point looks like this : package digit.endpoint; import java.util.List; import org.apache.log4j.Logger; import org.springframework.ws.context.MessageContext; import org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint; import digit.schema.Equipment; import digit.schema.GetEquipmentsRequest; import digit.schema.GetEquipmentsResponse; import digit.service.DigitService; import digit.utils.ObjectUtil; public class DigitEndpoint extends AbstractMarshallingPayloadEndpoint { private static Logger logger = Logger.getLogger(DigitEndpoint.class); private DigitService digitService; public DigitService getDigitService() { return digitService; } public void setDigitService(DigitService digitService) { this.digitService = digitService; } @Override protected Object invokeInternal(Object arg0) throws Exception { logger.info(" ---------------- Begin of invokeInternal -------------------------"); if(arg0 == null) { logger.fatal(" The request object is null"); throw new NullPointerException(" The request object is null "); } // get the request object ( i can verify that this is get very well ) GetEquipmentsRequest request = (GetEquipmentsRequest)arg0; String idEq = request.getId(); // call of my service implementation ( i can verify that this is fine) List<Equipment> listEq = digitService.getEquipments(); Equipment[] equipments = new Equipment [listEq.size()] ; // supplying the response (the problem with Axiom occurs here. The return object is built but nothing is not sent back.) // I precise that this problem does not occur with SAAJ GetEquipmentsResponse response = new GetEquipmentsResponse(); response.setEquipment(listEq.toArray(equipments)); logger.info(" ---------------- End of invokeInternal -------------------------"); return response; } } And its configuration is : <bean id="digitEndpoint" class="digit.endpoint.DigitEndpoint"> <property name="marshaller" ref="marshaller" /> <property name="unmarshaller" ref="marshaller" /> <property name="digitService"><ref bean="digitServiceImpl"/></property> </bean> <bean id="marshaller" class="org.springframework.oxm.castor.CastorMarshaller"> <property name="mappingLocation" value="classpath:mapping.xml" /> </bean> <bean id="digitServiceImpl" class="digit.service.DigitServiceImpl"> <property name="digitManager"><ref bean="equipementManager"/></property> </bean>
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        It seems like you don't have an AxiomSoapMessageFactory defined in that configuration. Try adding the following:

        <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory"/>

        in your config. Also, see http://static.springframework.org/spring-ws/sites/1.5/reference/html/common.html#d0e1248

        Show
        arjen.poutsma Arjen Poutsma added a comment - It seems like you don't have an AxiomSoapMessageFactory defined in that configuration. Try adding the following: <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory"/> in your config. Also, see http://static.springframework.org/spring-ws/sites/1.5/reference/html/common.html#d0e1248
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            atohoun Aristide Tohoun
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: