Announcement Announcement Module
No announcement yet.
marshalSendAndReceive not populating soap message, header and body null. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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: 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?

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

  • #2

    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.



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

      Spring config file
      <bean id="messageFactory" class=" ssageFactory"/>

      <bean name="webserviceTemplate" class=" 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 id="messageMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r"
      p:contextPaths="XXXXXXXX(endpoint name), ,, n._2010._1,,, _2010._1, ice._2010._1, nservice._2010._1"/>

      <bean id="emailService" class=" rviceImpl">
      <property name="webServiceTemplate" ref="webserviceTemplate" />
      <property name="marshaller" ref="messageMarshaller" />

      My client file

      public class EmailServiceImpl extends WebServiceGatewaySupport implements EmailService {

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

      private EmailDao emailDao;

      private Jaxb2Marshaller marshaller;

      protected Logger getLogger() {
      return LOGGER;

      public void saveEmail(Email email) throws ScosException{

      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.