Forum Discussion

ilpeppino's avatar
ilpeppino
New Contributor
9 years ago

Set JMS header properties with Groovy

Hi,

 

I'm using SOAPUI 5.0.0 free version. I created a Groovy script that reads xml files from a folder and creates test steps within a test case, using the xml as request messages. Even though the xml template message has JMSDeliveryMode set to NON_PERSISTENT and Add SoapAction as property to true, the test steps have the values set to PERSISTENT and false.

 

I wanted to know if it was possible to set these values with Groovy or configure it (somehow) in Hermes, so I can avoid to set manually these values for every created test step.

 

PS: if this can help, I looked into the xml file of the soapui project, and I see that these attributes are defined for the request messages in the following way:

 

<con:jmsConfig JMSDeliveryMode="NON_PERSISTENT" soapActionAdd="true"/>

Thanks for your help!!!

 

Giuseppe

 

    • ilpeppino's avatar
      ilpeppino
      New Contributor

      Hi, I can't post raw data for the non-working messsage (Add SoapAction = false in JMS Headers).

      For the working message, find it below:

       

      TextMessage={
      
      Header={ JMSMessageID={ID:vsvlnxtes000450.FD356190D19BB3F26:2}
      
      JMSDestination={Queue[blablabla]}
      
      JMSReplyTo={Queue[$TMP$.vsvlnxtes000450.FD356190D19BB3F26.2]}
      
      JMSDeliveryMode={NON_PERSISTENT}
      
      JMSRedelivered={false}
      
      JMSCorrelationID={null}
      
      JMSType={null}
      
      JMSTimestamp={Fri Dec 04 11:47:08 CET 2015}
      
      JMSExpiration={0}
      
      JMSPriority={4} }
      
      Properties={
      
      SOAPJMS_soapAction={String:UpdateDebitCardBlock_001}
      
      SOAPAction={String:DNL_CRDS_DebitCardBlock_001/UpdateDebitCardBlock_001}
      
      } 

      I think the Add SoapAction as property setting in JMS Headers, if true, adds the two lines in Properties, but I'm not sure.

       

      • nmrao's avatar
        nmrao
        Champion Level 3
        Like you mentioned, one should be able to add the custom headers with required values for jms soap request test step when it is required to set otherthan default value. In this case, you may add 'JMSDeliveryMode' with required value. Please try it and post the result if you still have issue.