Author |
Message
|
anil kumar |
Posted: Thu Jan 31, 2019 1:18 am Post subject: CRLF 's Stripped out from Message and Data Formatted wrong |
|
|
 Voyager
Joined: 22 Jan 2017 Posts: 98 Location: India
|
Hi All,
we are using IBM MQ 9 and Rest API Concept to put and get messages from IBM MQ using MQ Rest for messaging as mentioned in the info centre
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ref.dev.doc/q130750_.htm#q130750___requestformat
I am able to post(HTTP post ) and read messages(using HTTP delete) to and from the queue. I don't have any trouble when working with the XML, JSON messages. but when I tried with the flat file messages the messages are wrongly formatting in the queue. The queue is not considering carriage returns and line feeds posted in the HTTP post method's body.
yes I have correctly sent the media type to accepted format but messages are missing CR LF
below are examples
I'm using SOAP UI to test my MQ Rest API below are the cases I've encountered
Case 1:
Code: |
input :
Hellow
World
Media type :
text/plain;charset=utf-8
output in queue :
00000000 HellowWorld
|
Case 2:
Code: |
input :
Hellow
World
Media type :
text/html;charset=utf-8
output in queue :
00000000 HellowWorld
|
Case 3:
Code: |
input :
Hellow
World
Media type :
text/xml;charset=utf-8
output in queue :
00000000 HellowWorld
|
Please suggest how to get the message posted to queue as is without any reformatting.
 |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 31, 2019 4:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I don't see any immediate difference in the posted output.
Even though you've set them to UTF-8, are they? What are the OS involved?
The behavior you're describing is a classic for Windows <-> UNIX. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
anil kumar |
Posted: Thu Jan 31, 2019 5:26 am Post subject: |
|
|
 Voyager
Joined: 22 Jan 2017 Posts: 98 Location: India
|
Hi Vitor ,
yes, the Operating system is windows.
What am expecting here is CRLF in Queue.
This is a dummy test data but
Expected output is
Code: |
Hellow(expecting CRLF)
World (expecting CRLF)
|
not
Code: |
HellowWorld .missing CRLF |
All this is i want to post a flat file in fixed length format which is not formatting exactly as posted
below is example:
when I tried to post FixedLength Data which has a lot of CRLF the message was posted to Queue as a Single string in the linearized way all CR LF is missing.
Sample Input which has CRLF sent
Code: |
HEADER here header data some data
A1000000121312321313123123213213123123123123123123 TEST DATA 12312321321321
A101000000147752729000000603954082000000000000001TESTDATADUMMYDATA 000000000000000
A101000000147752729000000603954082000000000000002TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000003TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000004TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000005TESTDATADUMMYDATA 000000000000000
|
Code: |
HTTP logs in SOAP UI
Thu Jan 31 18:43:19 IST 2019:DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]"
Thu Jan 31 18:43:19 IST 2019:DEBUG:>> "[\r][\n]"
Thu Jan 31 18:43:19 IST 2019:DEBUG:>> "HEADER here header data some data[\n]"
Thu Jan 31 18:43:19 IST 2019:DEBUG:>> "A1000000121312321313123123213213123123123123123123 TEST DATA 12312321321321[\n]"
Thu Jan 31 18:43:19 IST 2019:DEBUG:>> "A101000000147752729000000603954082000000000000001TESTDATADUMMYDATA 000000000000000[\n]"
Thu Jan 31 18:43:19 IST 2019:DEBUG:>> "A101000000147752729000000603954082000000000000002TESTDATADUMMYDATA 000000000000000[\n]"
Thu Jan 31 18:43:19 IST 2019:DEBUG:>> "A201000000147752729000000603954082000000000000003TESTDATADUMMYDATA 000000000000000[\n]"
Thu Jan 31 18:43:19 IST 2019:DEBUG:>> "A201000000147752729000000603954082000000000000004TESTDATADUMMYDATA 000000000000000[\n]"
Thu Jan 31 18:43:19 IST 2019:DEBUG:>> "A201000000147752729000000603954082000000000000005TESTDATADUMMYDATA 000000000000000[\n]"
Thu Jan 31 18:43:19 IST 2019:DEBUG:<< "HTTP/1.1 201 Created[\r][\n]"
|
Output In Queue :
Code: |
00000000 HEADER here header data some dataA1000000121312321313123123213213123123123123123123 TEST DATA 12312321321321A101000000147752729000000603954082000000000000001TESTDATADUMMYDATA 000000000000000A101000000147752729000000603954082000000000000002TESTDATADUMMYDATA 000000000000000A201000000147752729000000603954082000000000000003TESTDATADUMMYDATA 000000000000000A201000000147752729000000603954082000000000000004TESTDATADUMMYDATA 000000000000000A201000000147752729000000603954082000000000000005TESTDATADUMMYDATA 000000000000000
|
Expecting output as
Code: |
HEADER here header data some data
A1000000121312321313123123213213123123123123123123 TEST DATA 12312321321321
A101000000147752729000000603954082000000000000001TESTDATADUMMYDATA 000000000000000
A101000000147752729000000603954082000000000000002TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000003TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000004TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000005TESTDATADUMMYDATA 000000000000000
|
what i'm expecting is data to be well formatter and outputted to Queue as is Am I missing something? |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Jan 31, 2019 5:56 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
anil kumar wrote: |
Hi Vitor ,
yes, the Operating system is windows.
What am expecting here is CRLF in Queue.
This is a dummy test data but
Expected output is
Code: |
Hellow(expecting CRLF)
World (expecting CRLF)
|
not
Code: |
HellowWorld .missing CRLF |
All this is i want to post a flat file in fixed length format which is not formatting exactly as posted
below is example:
when I tried to post FixedLength Data which has a lot of CRLF the message was posted to Queue as a Single string in the linearized way all CR LF is missing.
Sample Input which has CRLF sent
Code: |
HEADER here header data some data
A1000000121312321313123123213213123123123123123123 TEST DATA 12312321321321
A101000000147752729000000603954082000000000000001TESTDATADUMMYDATA 000000000000000
A101000000147752729000000603954082000000000000002TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000003TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000004TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000005TESTDATADUMMYDATA 000000000000000
|
|
What app are you using to display this? Does not look like output from the IBM-supplied utility app amqsbcg.
Display the messages in queue using amqsbcg. Post the results here. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
anil kumar |
Posted: Thu Jan 31, 2019 8:59 am Post subject: |
|
|
 Voyager
Joined: 22 Jan 2017 Posts: 98 Location: India
|
Hi Bruce ,
Im using RFHUTIL tool to view data . Also i have used HTTP Delete method to get the message from queue using SOAP UI . Both gave same respone .
I have run fresh test using same input and peformed GET using amqsbcg command the output is as below :
Code: |
MQGET of message number 1, CompCode:0 Reason:0
****Message descriptor****
StrucId : 'MD ' Version : 2
Report : 0 MsgType : 8
Expiry : -1 Feedback : 0
Encoding : 273 CodedCharSetId : 1208
Format : 'MQSTR '
Priority : 4 Persistence : 0
MsgId : X'414D5120534443514D47522E533120209488515C21E85502'
CorrelId : X'000000000000000000000000000000000000000000000000'
BackoutCount : 0
ReplyToQ : ' '
ReplyToQMgr : 'MYQMGR '
** Identity Context
UserIdentifier : ' '
AccountingToken :
X'0000000000000000000000000000000000000000000000000000000000000000'
ApplIdentityData : ' '
** Origin Context
PutApplType : '7'
PutApplName : 'IBM MQ Web Admin/REST API '
PutDate : '20190131' PutTime : '16544489'
ApplOriginData : ' '
GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'
**** Message ****
length - 548 of 548 bytes
00000000: 4845 4144 4552 2068 6572 6520 6865 6164 'HEADER here head'
00000010: 6572 2064 6174 6120 736F 6D65 2064 6174 'er data some dat'
00000020: 6141 3130 3030 3030 3031 3231 3331 3233 'aA10000001213123'
00000030: 3231 3331 3331 3233 3132 3332 3133 3231 '2131312312321321'
00000040: 3331 3233 3132 3331 3233 3132 3331 3233 '3123123123123123'
00000050: 3132 3320 5445 5354 2044 4154 4120 3132 '123 TEST DATA 12'
00000060: 3331 3233 3231 3332 3133 3231 4131 3031 '312321321321A101'
00000070: 3030 3030 3030 3134 3737 3532 3732 3930 '0000001477527290'
00000080: 3030 3030 3036 3033 3935 3430 3832 3030 '0000060395408200'
00000090: 3030 3030 3030 3030 3030 3030 3154 4553 '0000000000001TES'
000000A0: 5444 4154 4144 554D 4D59 4441 5441 2020 'TDATADUMMYDATA '
000000B0: 2020 2020 2030 3030 3030 3030 3030 3030 ' 00000000000'
000000C0: 3030 3030 4131 3031 3030 3030 3030 3134 '0000A10100000014'
000000D0: 3737 3532 3732 3930 3030 3030 3036 3033 '7752729000000603'
000000E0: 3935 3430 3832 3030 3030 3030 3030 3030 '9540820000000000'
000000F0: 3030 3030 3254 4553 5444 4154 4144 554D '00002TESTDATADUM'
00000100: 4D59 4441 5441 2020 2020 2020 2030 3030 'MYDATA 000'
00000110: 3030 3030 3030 3030 3030 3030 4132 3031 '000000000000A201'
00000120: 3030 3030 3030 3134 3737 3532 3732 3930 '0000001477527290'
00000130: 3030 3030 3036 3033 3935 3430 3832 3030 '0000060395408200'
00000140: 3030 3030 3030 3030 3030 3030 3354 4553 '0000000000003TES'
00000150: 5444 4154 4144 554D 4D59 4441 5441 2020 'TDATADUMMYDATA '
00000160: 2020 2020 2030 3030 3030 3030 3030 3030 ' 00000000000'
00000170: 3030 3030 4132 3031 3030 3030 3030 3134 '0000A20100000014'
00000180: 3737 3532 3732 3930 3030 3030 3036 3033 '7752729000000603'
00000190: 3935 3430 3832 3030 3030 3030 3030 3030 '9540820000000000'
000001A0: 3030 3030 3454 4553 5444 4154 4144 554D '00004TESTDATADUM'
000001B0: 4D59 4441 5441 2020 2020 2020 2030 3030 'MYDATA 000'
000001C0: 3030 3030 3030 3030 3030 3030 4132 3031 '000000000000A201'
000001D0: 3030 3030 3030 3134 3737 3532 3732 3930 '0000001477527290'
000001E0: 3030 3030 3036 3033 3935 3430 3832 3030 '0000060395408200'
000001F0: 3030 3030 3030 3030 3030 3030 3554 4553 '0000000000005TES'
00000200: 5444 4154 4144 554D 4D59 4441 5441 2020 'TDATADUMMYDATA '
00000210: 2020 2020 2030 3030 3030 3030 3030 3030 ' 00000000000'
00000220: 3030 3030 '0000 '
|
i have checked the hexa decimal code also still can't find 0D0A |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Jan 31, 2019 9:30 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
MQ doesn't know or care about CRLFs. Why do you expect that there should be CRLFs in the message? Does your app insert CRLFs? Display the source input file data here. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
anil kumar |
Posted: Thu Jan 31, 2019 10:37 pm Post subject: |
|
|
 Voyager
Joined: 22 Jan 2017 Posts: 98 Location: India
|
Hi Bruce,
I have run another test collected HTTP log in SOAP UI, there I can see CRLF are sent from Soap UI. So source app is sending the data correctly once posted queue is showing data in a single linearized string.
Below are test result :
Http Post request log :
Code: |
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "POST /ibmmq/rest/v1/messaging/qmgr/MYQMGR/queue/REST.TEST/message HTTP/1.1[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "Content-Type: text/plain;charset=utf-8[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "Content-Length: 562[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "Connection: Keep-Alive[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "HEADER here header data some data[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "A1000000121312321313123123213213123123123123123123 TEST DATA 12312321321321[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "A101000000147752729000000603954082000000000000001TESTDATADUMMYDATA 000000000000000[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "A101000000147752729000000603954082000000000000002TESTDATADUMMYDATA 000000000000000[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "A201000000147752729000000603954082000000000000003TESTDATADUMMYDATA 000000000000000[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "A201000000147752729000000603954082000000000000004TESTDATADUMMYDATA 000000000000000[\r][\n]"
Fri Feb 01 08:37:31 IST 2019:DEBUG:>> "A201000000147752729000000603954082000000000000005TESTDATADUMMYDATA 000000000000000[\r][\n]"
|
HTTP response which says data has been posted to Queue :
Code: |
Fri Feb 01 08:37:32 IST 2019:DEBUG:<< "HTTP/1.1 201 Created[\r][\n]"
Fri Feb 01 08:37:32 IST 2019:DEBUG:<< "X-Powered-By: Servlet/3.1[\r][\n]"
Fri Feb 01 08:37:32 IST 2019:DEBUG:<< "X-XSS-Protection: 1;mode=block[\r][\n]"
Fri Feb 01 08:37:32 IST 2019:DEBUG:<< "X-Content-Type-Options: nosniff[\r][\n]"
Fri Feb 01 08:37:32 IST 2019:DEBUG:<< "Content-Length: 0[\r][\n]"
Fri Feb 01 08:37:32 IST 2019:DEBUG:<< "Content-Type: text/plain; charset=utf-8[\r][\n]"
Fri Feb 01 08:37:32 IST 2019:DEBUG:<< "ibm-mq-md-messageId: 414d5120534443514d47522e533120209488515c220e7102[\r][\n]" got message id in return from queue
Fri Feb 01 08:37:32 IST 2019:DEBUG:<< "Date: Fri, 01 Feb 2019 03:07:31 GMT[\r][\n]"
Fri Feb 01 08:37:32 IST 2019:DEBUG:<< "[\r][\n]"
|
below is a message posted to the queue
Code: |
AMQSBCG0 - starts here
**********************
MQOPEN - 'REST.TEST'
MQGET of message number 1, CompCode:0 Reason:0
****Message descriptor****
StrucId : 'MD ' Version : 2
Report : 0 MsgType : 8
Expiry : -1 Feedback : 0
Encoding : 273 CodedCharSetId : 1208
Format : 'MQSTR '
Priority : 4 Persistence : 0
MsgId : X'414D5120534443514D47522E533120209488515C220E7102'
CorrelId : X'000000000000000000000000000000000000000000000000'
BackoutCount : 0
ReplyToQ : ' '
ReplyToQMgr : 'MYQMGR '
** Identity Context
UserIdentifier : ' '
AccountingToken :
X'0000000000000000000000000000000000000000000000000000000000000000'
ApplIdentityData : ' '
** Origin Context
PutApplType : '7'
PutApplName : 'IBM MQ Web Admin/REST API '
PutDate : '20190201' PutTime : '03073171'
ApplOriginData : ' '
GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'
**** Message ****
length - 548 of 548 bytes
00000000: 4845 4144 4552 2068 6572 6520 6865 6164 'HEADER here head'
00000010: 6572 2064 6174 6120 736F 6D65 2064 6174 'er data some dat'
00000020: 6141 3130 3030 3030 3031 3231 3331 3233 'aA10000001213123'
00000030: 3231 3331 3331 3233 3132 3332 3133 3231 '2131312312321321'
00000040: 3331 3233 3132 3331 3233 3132 3331 3233 '3123123123123123'
00000050: 3132 3320 5445 5354 2044 4154 4120 3132 '123 TEST DATA 12'
00000060: 3331 3233 3231 3332 3133 3231 4131 3031 '312321321321A101'
00000070: 3030 3030 3030 3134 3737 3532 3732 3930 '0000001477527290'
00000080: 3030 3030 3036 3033 3935 3430 3832 3030 '0000060395408200'
00000090: 3030 3030 3030 3030 3030 3030 3154 4553 '0000000000001TES'
000000A0: 5444 4154 4144 554D 4D59 4441 5441 2020 'TDATADUMMYDATA '
000000B0: 2020 2020 2030 3030 3030 3030 3030 3030 ' 00000000000'
000000C0: 3030 3030 4131 3031 3030 3030 3030 3134 '0000A10100000014'
000000D0: 3737 3532 3732 3930 3030 3030 3036 3033 '7752729000000603'
000000E0: 3935 3430 3832 3030 3030 3030 3030 3030 '9540820000000000'
000000F0: 3030 3030 3254 4553 5444 4154 4144 554D '00002TESTDATADUM'
00000100: 4D59 4441 5441 2020 2020 2020 2030 3030 'MYDATA 000'
00000110: 3030 3030 3030 3030 3030 3030 4132 3031 '000000000000A201'
00000120: 3030 3030 3030 3134 3737 3532 3732 3930 '0000001477527290'
00000130: 3030 3030 3036 3033 3935 3430 3832 3030 '0000060395408200'
00000140: 3030 3030 3030 3030 3030 3030 3354 4553 '0000000000003TES'
00000150: 5444 4154 4144 554D 4D59 4441 5441 2020 'TDATADUMMYDATA '
00000160: 2020 2020 2030 3030 3030 3030 3030 3030 ' 00000000000'
00000170: 3030 3030 4132 3031 3030 3030 3030 3134 '0000A20100000014'
00000180: 3737 3532 3732 3930 3030 3030 3036 3033 '7752729000000603'
00000190: 3935 3430 3832 3030 3030 3030 3030 3030 '9540820000000000'
000001A0: 3030 3030 3454 4553 5444 4154 4144 554D '00004TESTDATADUM'
000001B0: 4D59 4441 5441 2020 2020 2020 2030 3030 'MYDATA 000'
000001C0: 3030 3030 3030 3030 3030 3030 4132 3031 '000000000000A201'
000001D0: 3030 3030 3030 3134 3737 3532 3732 3930 '0000001477527290'
000001E0: 3030 3030 3036 3033 3935 3430 3832 3030 '0000060395408200'
000001F0: 3030 3030 3030 3030 3030 3030 3554 4553 '0000000000005TES'
00000200: 5444 4154 4144 554D 4D59 4441 5441 2020 'TDATADUMMYDATA '
00000210: 2020 2020 2030 3030 3030 3030 3030 3030 ' 00000000000'
00000220: 3030 3030 '0000 '
|
|
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Feb 02, 2019 2:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
So what you're saying is that the REST API strips CR/LF from the data?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Feb 02, 2019 10:27 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Where did the data originate? On z/OS perhaps?
What app did you use to create the source data? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
gbaddeley |
Posted: Sun Feb 03, 2019 3:10 pm Post subject: Re: CRLF 's Stripped out from Message and Data Formatted wro |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
anil kumar wrote: |
Hi All,
we are using IBM MQ 9 and Rest API Concept to put and get messages from IBM MQ using MQ Rest for messaging as mentioned in the info centre
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ref.dev.doc/q130750_.htm#q130750___requestformat
I am able to post(HTTP post ) and read messages(using HTTP delete) to and from the queue. I don't have any trouble when working with the XML, JSON messages. but when I tried with the flat file messages the messages are wrongly formatting in the queue. The queue is not considering carriage returns and line feeds posted in the HTTP post method's body.
yes I have correctly sent the media type to accepted format but messages are missing CR LF
below are examples
I'm using SOAP UI to test my MQ Rest API below are the cases I've encountered
Please suggest how to get the message posted to queue as is without any reformatting.
 |
It looks like the MQ HTTP POST processing is stripping the CR LF. I could not see anything about multi-line data on the the IBM KC page linked above.
Have you tried the curl command examples? Note that to post a multi-line text file without stripping CR LF you need to use "--data-binary @FileName.txt" (as described at https://ec.haxx.se/http-post.html ) _________________ Glenn |
|
Back to top |
|
 |
anil kumar |
Posted: Tue Feb 05, 2019 10:11 pm Post subject: Re: CRLF 's Stripped out from Message and Data Formatted wro |
|
|
 Voyager
Joined: 22 Jan 2017 Posts: 98 Location: India
|
gbaddeley wrote: |
anil kumar wrote: |
Hi All,
we are using IBM MQ 9 and Rest API Concept to put and get messages from IBM MQ using MQ Rest for messaging as mentioned in the info centre
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ref.dev.doc/q130750_.htm#q130750___requestformat
I am able to post(HTTP post ) and read messages(using HTTP delete) to and from the queue. I don't have any trouble when working with the XML, JSON messages. but when I tried with the flat file messages the messages are wrongly formatting in the queue. The queue is not considering carriage returns and line feeds posted in the HTTP post method's body.
yes I have correctly sent the media type to accepted format but messages are missing CR LF
below are examples
I'm using SOAP UI to test my MQ Rest API below are the cases I've encountered
Please suggest how to get the message posted to queue as is without any reformatting.
 |
It looks like the MQ HTTP POST processing is stripping the CR LF. I could not see anything about multi-line data on the the IBM KC page linked above.
Have you tried the curl command examples? Note that to post a multi-line text file without stripping CR LF you need to use "--data-binary @FileName.txt" (as described at https://ec.haxx.se/http-post.html ) |
hi Baddeley,
Hi have used curl and read the data from a file and still missing out the Carriage returns and line feeds.
Code: |
Curl Command :
curl -v -k "http://myhost:myport/ibmmq/rest/v1/messaging/qmgr/MYQMGR/queue/REST.TEST/message" -X POST -H "ibm-mq-rest-csrf-token: token-value" -H "Content-Type:text/plain;charset=utf-8" -H "ibm-mq-md-persistence: nonPersistent" --data-binary @C:\Users\username\Desktop\dump\testmessage.txt
|
Code: |
Input File (testmessage.txt) data :
HEADER here header data some data
A1000000121312321313123123213213123123123123123123 TEST DATA 12312321321321
A101000000147752729000000603954082000000000000001TESTDATADUMMYDATA 000000000000000
A101000000147752729000000603954082000000000000002TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000003TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000004TESTDATADUMMYDATA 000000000000000
A201000000147752729000000603954082000000000000005TESTDATADUMMYDATA 000000000000000
|
Code: |
output in Queue :
00000000 HEADER h ere head 48454144 45522068 65726520 68656164
00000016 er data some dat 65722064 61746120 736F6D65 20646174
00000032 aA100000 01213123 61413130 30303030 30313231 33313233
00000048 21313123 12321321 32313331 33313233 31323332 31333231
00000064 31231231 23123123 33313233 31323331 32333132 33313233
00000080 123 TEST DATA 12 31323320 54455354 20444154 41203132
00000096 31232132 1321A101 33313233 32313332 31333231 41313031
00000112 00000014 77527290 30303030 30303134 37373532 37323930
00000128 00000603 95408200 30303030 30363033 39353430 38323030
00000144 00000000 00001TES 30303030 30303030 30303030 31544553
00000160 TDATADUM MYDATA 54444154 4144554D 4D594441 54412020
00000176 000 00000000 20202020 20303030 30303030 30303030
00000192 0000A101 00000014 30303030 41313031 30303030 30303134
00000208 77527290 00000603 37373532 37323930 30303030 30363033
00000224 95408200 00000000 39353430 38323030 30303030 30303030
00000240 00002TES TDATADUM 30303030 32544553 54444154 4144554D
00000256 MYDATA 000 4D594441 54412020 20202020 20303030
00000272 00000000 0000A201 30303030 30303030 30303030 41323031
00000288 00000014 77527290 30303030 30303134 37373532 37323930
00000304 00000603 95408200 30303030 30363033 39353430 38323030
00000320 00000000 00003TES 30303030 30303030 30303030 33544553
00000336 TDATADUM MYDATA 54444154 4144554D 4D594441 54412020
00000352 000 00000000 20202020 20303030 30303030 30303030
00000368 0000A201 00000014 30303030 41323031 30303030 30303134
00000384 77527290 00000603 37373532 37323930 30303030 30363033
00000400 95408200 00000000 39353430 38323030 30303030 30303030
00000416 00004TES TDATADUM 30303030 34544553 54444154 4144554D
00000432 MYDATA 000 4D594441 54412020 20202020 20303030
00000448 00000000 0000A201 30303030 30303030 30303030 41323031
00000464 00000014 77527290 30303030 30303134 37373532 37323930
00000480 00000603 95408200 30303030 30363033 39353430 38323030
00000496 00000000 00005TES 30303030 30303030 30303030 35544553
00000512 TDATADUM MYDATA 54444154 4144554D 4D594441 54412020
00000528 000 00000000 20202020 20303030 30303030 30303030
00000544 0000 30303030 |
|
|
Back to top |
|
 |
anil kumar |
Posted: Tue Feb 05, 2019 10:22 pm Post subject: |
|
|
 Voyager
Joined: 22 Jan 2017 Posts: 98 Location: India
|
bruce2359 wrote: |
Where did the data originate? On z/OS perhaps?
What app did you use to create the source data? |
Hi Bruce,
I'm using notepad++ to create data. and os is windows.
fjb_saper wrote: |
So what you're saying is that the REST API strips CR/LF from the data? |
yes, I think the rest API is working behind. but not sure that's why asking if anyone of forum users is using this feature or did POC kind of things so that someone may advise.
I would like to get a suggestion on if this feature supports does not support multiline data . or it will only support the XML/JSON only?
any comment on that ? |
|
Back to top |
|
 |
hughson |
Posted: Tue Feb 05, 2019 11:42 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
anil kumar wrote: |
fjb_saper wrote: |
So what you're saying is that the REST API strips CR/LF from the data? |
yes, I think the rest API is working behind. but not sure that's why asking if anyone of forum users is using this feature or did POC kind of things so that someone may advise.
I would like to get a suggestion on if this feature supports does not support multiline data . or it will only support the XML/JSON only?
any comment on that ? |
I've been playing with the REST messaging API for a bit too and tried all sorts of combinations to get newlines, but with no luck.
I've asked IBM Hursley to take a look at this thread in the hope of getting you a definitive answer.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
anil kumar |
Posted: Wed Feb 06, 2019 9:20 pm Post subject: |
|
|
 Voyager
Joined: 22 Jan 2017 Posts: 98 Location: India
|
Thanks, Morag
please let me also know when you get an update on this.
Thanks,
Anil. |
|
Back to top |
|
 |
mvic |
Posted: Fri Feb 15, 2019 12:53 pm Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
Is there a reason no-one has suggested opening a PMR for this? |
|
Back to top |
|
 |
|