ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Content-Length Header is always Zero for POST method

Post new topic  Reply to topic
 Content-Length Header is always Zero for POST method « View previous topic :: View next topic » 
Author Message
subbaraju
PostPosted: Mon Apr 08, 2019 11:21 pm    Post subject: Content-Length Header is always Zero for POST method Reply with quote

Newbie

Joined: 13 May 2014
Posts: 2

Hi,

I am trying to connect the Rest API from IIB v9. I am using a POST method and I am passing JSON message and the http headers in the request. But I am always getting 400 Bad request error from HOST, because the content-Length Header is showing as zero even I am sending the request JSON body message. I am using HTTP request node to call the host.

Please some one help me to resolve this.
Back to top
View user's profile Send private message
subbaraju
PostPosted: Mon Apr 08, 2019 11:29 pm    Post subject: Reply with quote

Newbie

Joined: 13 May 2014
Posts: 2

Below is my JSON request.

(0x01000000:Object):JSON = ( ['json' : 0x7fdf6ae4ecb0]
(0x01000000:Object):Data = (
(0x01000000:Object ):selectedDebitAccount = (
(0x03000000:NameValue):branchCode = '016' (CHARACTER)
(0x03000000:NameValue):accountNumber = '1379026' (CHARACTER)
(0x03000000:NameValue):accountType = 'SAVINGS' (CHARACTER)
(0x03000000:NameValue):accountName = 'FAMILY NAME 200006205' (CHARACTER)
)
(0x03000000:NameValue):amountPayable = '1.0' (CHARACTER)
(0x03000000:NameValue):currency = 'ZMW' (CHARACTER)
(0x03000000:NameValue):paymentReference = '96958719020481' (CHARACTER)
(0x01000000:Object ):selectedCorporateProfileClient = (
(0x03000000:NameValue):clientId = '510115383946403840' (CHARACTER)
(0x03000000:NameValue):clientName = 'Retail Business Banking' (CHARACTER)
(0x03000000:NameValue):domicileCountryCode = 'ZMB' (CHARACTER)
)
(0x01001000:Array ):obligationList = (
(0x01000000:Object):Item = (
(0x03000000:NameValue):referenceNumber = '96958719020485' (CHARACTER)
(0x03000000:NameValue):registrationId = '96958719020485' (CHARACTER)
(0x03000000:NameValue):currency = 'ZMW' (CHARACTER)
(0x03000000:NameValue):amountPayable = '1.0' (CHARACTER)
)
)
)
)

And below are my headers.

(0x01000000:Name):HTTPRequestHeader = ( ['WSREQHDR' : 0x7fdf69d84840]
(0x03000000:NameValue):Content-Length = '0' (CHARACTER)
(0x03000000:NameValue):Content-Type = 'application/json' (CHARACTER)
(0x03000000:NameValue):Accept = 'application/json' (CHARACTER)
(0x03000000:NameValue):X-API-KEY = '2e0cd740-cfd5-4338-be51-45da7048abcd' (CHARACTER)
(0x03000000:NameValue):Authorization = 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjRDNkE3RjIxQjkxMTA0M0NGMzFGNDdGQTRFMjhGODJCRjAxQzUzN0EiLCJ0eXAiOiJKV1QiLCJ4NXQiOiJUR3BfSWJrUkJEenpIMGY2VGlqNEtfQWNVM28ifQ.eyJuYmYiOjE1NTQ3OTE2NTMsImV4cCI6MTU1NDc5MjI1MywiaXNzIjoiaHR0cHM6Ly9qaGJkc20wMjAwMDA0MzUuaW50cmFuZXQuYmFyY2FwaW50LmNvbTo4MDkyIiwiYXVkIjpbImh0dHBzOi8vamhiZHNtMDIwMDAwNDM1LmludHJhbmV0LmJhcmNhcGludC5jb206ODA5Mi9yZXNvdXJjZXMiLCJGYWJyaWNHYXRld2F5QXBpIl0sImNsaWVudF9pZCI6IkFQSUNsaWVudCIsInN1YiI6IjUxMDE1NTMwODk1MTU2ODM4NCIsImF1dGhfdGltZSI6MTU1NDc5MTY1MywiaWRwIjoibG9jYWwiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJTb2xlVXNlciIsImNvbm5lY3RlZF9leHBlcmllbmNlcyI6WyJiaWxsZXJzIiwidHJhIl0sImdpdmVuX25hbWUiOiJTb2xlIiwiZmFtaWx5X25hbWUiOiJVc2VyIiwibG9jYWxlIjoiZW4temEiLCJzY29wZSI6WyJGYWJyaWNHYXRld2F5QXBpIl0sImFtciI6WyJjdXN0b20iXX0.bQRyPYx2lc3KL8uyB2MXwdx8FILUMkVXtBXKd9OJnuHsEuSca6oMZdLqfx4jXcy7y__nEbiZaydmYPkI_r-We2P354nzo9h2ZBXd-wNqVxzUfVhQxiX7dkx9FRcMZPvdEGummgHtyzhUKgOhp4MYyp7r64tiIjydtTRwpmG-defPc39sxK-Fpdp-7xHCq_qaPtX58tdMjH0XoTuyYTiE45k2_CWgWRh_uomUT_jUe4pBZDQu8agLu1S1oWMafSCxamfeTDHl1l7OC_2A25_xYxjdFhtj6_S_8jC04gP-26s0LTiGddndm6i-r_6RSpegFdk7kV6JEAKDL9NAWI2law' (CHARACTER)
(0x03000000:NameValue):code = 'napsa-pen' (CHARACTER)
(0x03000000:NameValue):billerCode = 'napsa' (CHARACTER)
(0x03000000:NameValue):bankCode = 'BBZ' (CHARACTER)
(0x03000000:NameValue):userId = '123456' (CHARACTER)
(0x03000000:NameValue):bank = 'true' (CHARACTER)
(0x03000000:NameValue):billerName = 'National Pension Scheme Authority (NAPSA)' (CHARACTER)
(0x03000000:NameValue):footer = 'Absa Bank Zambia PLC is regulated by Bank of Zambia under licence No. BL002/1918B, whose registered office is at stand numbers 4643 and 4644 Elunda Office Park, Addis Ababa Round About, Lusaka , Zambia' (CHARACTER)
(0x03000000:NameValue):logo = 'document/logos/napsa-pen.png' (CHARACTER)
(0x03000000:NameValue):timeZone = 'Africa/Maputo' (CHARACTER)
(0x03000000:NameValue):name = 'National Pension Scheme Authority' (CHARACTER)
(0x03000000:NameValue):cache-control = 'no-cache' (CHARACTER)
(0x03000000:NameValue):accept-encoding = 'gzip, deflate' (CHARACTER)
(0x03000000:NameValue):Host = 'api-uat.apps.nonprod.ocp.absa.co.za' (CHARACTER)
(0x03000000:NameValue):SOAPAction = '""' (CHARACTER)
(0x03000000:NameValue):Connection = 'Keep-Alive' (CHARACTER)
)


Here you can see Content-Length is zero. Don't know why the content-Length header is always zero for POST method.
Back to top
View user's profile Send private message
abhi_thri
PostPosted: Tue Apr 09, 2019 12:27 am    Post subject: Reply with quote

Knight

Joined: 17 Jul 2017
Posts: 516
Location: UK

hi...have you tried invoking the webservice outside of IIB just to see it works as expected, eg: using curl, SoapUI, any SOA/ReST browser plugins etc. If this works you can then compare it against the IIB request.

Also, try taking an user trace of the flow to see whether it shows any further errors
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Content-Length Header is always Zero for POST method
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.