Page 1 of 1

Specify Custom Content Type for OutboundXMLBind

Posted: Sat Jan 07, 2023 6:12 am
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.

Re: Specify Custom Content Type for OutboundXMLBind

Posted: Mon Jan 09, 2023 11:25 am
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

Re: Specify Custom Content Type for OutboundXMLBind

Posted: Tue Jan 10, 2023 5:12 am
by caseywhite
Thanks Tim.