Announcement Announcement Module
Collapse
No announcement yet.
marshalSendAndReceive not populating soap message, header and body null. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • marshalSendAndReceive not populating soap message, header and body null.

    Hi all,
    I hope a good weekend was had by everybody?

    Ok so this is bizarre, I have a wsdl object that I can marshal and un-marshal to file really ease (once I hack it to have a root element). But strangely marshalSendAndReceive dosnt seem to want to create a soap message for it.

    I just thought I had done something wrong, so I put a call back on marshalSendAndReceive so I could have a look at what was being created before it was sent, mainly the headers. Nothing, no header, and no body.

    What I get as an exception is:
    org.springframework.ws.soap.client.SoapFaultClient Exception: Invalid SOAPAction header:

    This is very odd.

    Has anybody seen this before? Any ideas why?

    Could this be a mismatch in versions of things like saaj and jaxb?

    Thanks
    G
    Last edited by Encrypt; Aug 23rd, 2010, 06:46 AM. Reason: added exception

  • #2
    Solved

    I was being totally thick.
    I need to put the action into the soap message, it didnt seem to be picking it up from the marshalling.

    I dont know why, either its the way the wsdl has been written or the fact that I am having to wrap the request object into JAXBElement so that it will marshal.

    Oh well.

    sorry about the spam.

    G

    Comment


    • #3
      Soap Envelope is null while marshalling and sending the message.

      Spring config file
      ========================
      <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMe ssageFactory"/>

      <bean name="webserviceTemplate" class="org.springframework.ws.client.core.WebServi ceTemplate">
      <constructor-arg ref="messageFactory"/>
      <property name="defaultUri" value="http://ifappd103d-v07t:8006/service/ArchiveNotificationService" />
      <property name="marshaller" ref="messageMarshaller" />
      <property name="unmarshaller" ref="messageMarshaller" />
      </bean>

      <bean id="messageMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r"
      p:contextPaths="XXXXXXXX(endpoint name),
      au.com.sensis._if.cmf.sifapplicationevent._2007._1 ,
      au.com.sensis._if.cmf.sifcommon._2007._1,
      au.com.sensis._if.cmf.sifcustomernotificationcommo n._2010._1,
      au.com.sensis._if.cmf.sifexceptionevent._2007._1,
      au.com.sensis._if.service.sifarchive._2010._1,
      au.com.sensis._if.service.sifcreatecontentservice. _2010._1,
      au.com.sensis._if.service.sifdistributecontentserv ice._2010._1,
      au.com.sensis._if.service.sifenterprisenotificatio nservice._2010._1"/>

      <bean id="emailService" class="au.com.sensis.scos.api.service.impl.EmailSe rviceImpl">
      <property name="webServiceTemplate" ref="webserviceTemplate" />
      <property name="marshaller" ref="messageMarshaller" />
      </bean>
      ======================================\

      My client file

      public class EmailServiceImpl extends WebServiceGatewaySupport implements EmailService {

      private static final Logger LOGGER = LoggerFactory.getLogger(AdvertiserServiceImpl.clas s);


      @Autowired
      @Qualifier(value="emailDao")
      private EmailDao emailDao;


      @Autowired
      @Qualifier(value="messageMarshaller")
      private Jaxb2Marshaller marshaller;

      protected Logger getLogger() {
      return LOGGER;
      }


      public void saveEmail(Email email) throws ScosException{
      getWebServiceTemplate().setMarshaller(marshaller);

      ArchiveNotificationServiceResponseType response = (ArchiveNotificationServiceResponseType)
      getWebServiceTemplate().marshalSendAndReceive(arch iveNotificationServiceRequest);

      System.out.println("Content : \n " + response.getContent());
      System.out.println("Error : \n " + response.getError().getReason());
      System.out.println("Error : \n " + response.getError().getErrorCode());


      }

      }

      Can you please tell me what I'm doing wrong?

      I haven't provided the full code but most of the code is there.

      Comment

      Working...
      X