Specify Custom Content Type for OutboundXMLBind

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
caseywhite
Posts: 192
Joined: Thu May 26, 2016 1:17 am

Specify Custom Content Type for OutboundXMLBind

Post by caseywhite »

I have an API that I need to call that accepts a JSON payload, but will only respond in JSON if you pass a custom Content Type instead of the default Content Type of "Content-Type: application/json; charset=utf-8" that is used by the LANSA Integrator OutboundJSONBindHandler. I have tried setting the CONTENT value on the SERVICE_LOAD as well as on the SEND. I have even set a custom property of Content-Type but the HTTP_PROTOCOL still shows the default content type as the first content type so I suspect the custom property I added is not being recognized.

I have tried this using HTTPService with the OutboundJSONBind handler and HTTPOutboundJSONBind service.

Is anyone aware of whether it is possible, and if so, how I can override the default content type being set by LANSA Integrator when attempting to send JSON using the OutboundJSONBind service.

Thanks.
Tim McEntee
Posts: 57
Joined: Thu May 26, 2016 8:46 am

Re: Specify Custom Content Type for OutboundXMLBind

Post by Tim McEntee »

Hi Casey

Try saving the outgoing JSON as a file then use HttpService with the Outboundfile content handler. You can set the content on the send.

Tim
caseywhite
Posts: 192
Joined: Thu May 26, 2016 1:17 am

Re: Specify Custom Content Type for OutboundXMLBind

Post by caseywhite »

Thanks Tim.
Post Reply