Error : illegal character 'R' at offset 0 when sending an XML message to JMS Queue
Hi,
I have written a groovy script which creates an xml file and then tries to send the created xml to a JMS queue.
but I am seeing an exception(in my application's log which reads : "illegal character 'R' at offset 0"
I followed the steps mentioned here(used Byte instead of Text) : https://www.soapui.org/jms/working-with-jms-messages.html
When I tried to copy the created xml and posted the same through RFHUTILC, I don't see any error.
Sample of what I tried to do :
def jmsEndpoint = new JMSEndpoint("jms://MQSession::QueueName")
def hermes = HermesUtils.getHermes( context.testCase.testSuite.project, jmsEndpoint.sessionName)
def jmsConnectionHolder = new JMSConnectionHolder( jmsEndpoint, hermes, false, null ,null ,null)
Session queueSession = jmsConnectionHolder.getSession();
Queue queueSend = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getSend() );
//Queue queueBrowse = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getReceive() );
MessageProducer messageProducer = queueSession.createProducer( queueSend );
BytesMessage textMessageSend = queueSession.createBytesMessage();
< my XML creation code goes here which I have captured in the var updatedXml >
textMessageSend.writeUTF(updatedXml);
messageProducer.send(textMessageSend);