Forum Discussion

mnogales's avatar
mnogales
New Contributor
4 years ago

Set JMSMessageID in HERMES JMS Soap Request

Hello,

I need to set the JMSMessageID in a Soap Request, for this request I use the Hermes JMS.

I set the MessageId property "PEPE" in WS-A, and check the "Enable WS-A addresing" check button.

 

When I sent the request I can see the following log:

JMSMessageID: ID:414d5120514d4e495545582020202020602647db2049230f.

¿How can I set this property?

I can set the JMSCorrelationId Property, but I can't set the JMSMessageId property

 

 

  • mnogales's avatar
    mnogales
    New Contributor

    I have also tried to make a script in groovy:

     

    import com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder
    import com.eviware.soapui.impl.wsdl.submit.transports.jms.util.HermesUtils
    import com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSEndpoint
    import hermes.Hermes
    import javax.jms.*

    //Establishing the JMS connection
    def jmsEndpoint = new JMSEndpoint("jms://SIAAM::queue_COLAMQ1");
    def hermes = HermesUtils.getHermes( context.testCase.testSuite.project, jmsEndpoint.sessionName)
    def jmsConnectionHolder = new JMSConnectionHolder( jmsEndpoint, hermes, false, null, null, null);

    // Obtaining the session and queue
    Session queueSession = jmsConnectionHolder.getSession();
    Queue queueSend = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getSend() );
    Queue queueBrowse = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getReceive() );

    // Performing some actions


    MessageProducer messageProducer = queueSession.createProducer( queueSend );
    TextMessage textMessageSend = queueSession.createTextMessage();
    textMessageSend.setJMSCorrelationID('PEPEP')

    textMessageSend.setJMSMessageID("PEPEITO")

    textMessageSend.setText( """
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <PEPE_E2E>
    </PEPE_E2E>

    """);
    messageProducer.send( textMessageSend );

    // Logging elements
    QueueBrowser qb = queueSession.createBrowser(queueBrowse);
    Enumeration en = qb.getEnumeration();
    while(en.hasMoreElements())
    {
    TextMessage tm = (TextMessage)en.nextElement();
    log.info tm.getText()
    }
    jmsConnectionHolder.closeAll() // Make sure to close the session and connection

     

    I can modify JMSCorrelationID, but I can't modify JMSMessageID