XPRIM_HTTPREQUEST remove multipart message?

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
brendanjb91
Posts: 1
Joined: Mon Oct 04, 2021 8:20 pm

XPRIM_HTTPREQUEST remove multipart message?

Post by brendanjb91 »

Hi,

I’ve hit a bit of a bottleneck with the VL14 #XPRIM_HttpRequest class.

I am trying to build up an XML which sends across to our iPaaS software via an API.

The XML string can be fairly big (over 100,000 characters) however I’m hitting a limit which I believe is 65,535 characters on this method:

Even having #uOutBoundXML as a PRIM_ALPH with a length of 100,000 does not work as I think the bottleneck is the Content.AddString method (65,535?)

#uRequest.Content.AddString Value(#uOutboundXML)

The above only sends the first 65,535 characters through which is the max string limit. I tried getting around this by calling .uAddString again to add another message to the request..

#uRequest.Content.AddString Value(#uOutboundXML_2)

Howver this then sends the message through as a multipart message which includes a boudary such as "--kjOatbCwl5M01gIztMCnPtT5eBOPZXOs6MJBiZc2cNMguSlp3vU3b6mJHBVYfROi"

All I want is the request to have OutboundXML and OutboundXML_2 joiuned together as i'm sending it through as XML. I have tried setting the mediatype to both application/xml and text/plain however i'm still getting the multipart/boundary.

Anyone any tips?
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

Re: XPRIM_HTTPREQUEST remove multipart message?

Post by BrendanB »

I suspect that one option you could try:

Code: Select all

Define_com class(#prim_dc.unicodestring) name(#string1)
Define_com class(#prim_dc.unicodestring) name(#string2)
Define_com class(#xprim_binary) name(#binary)

* populate #string1 with up to 65535 chars
* populate #string2 with up to 65535 chars

#binary.FromAppending First(#string1) Second(#string2)

#uRequest.Content.AddString Value(#binary.AsStringUsingUTF8)

This may get you around the 65535 char limit (which is the limit for a #prim_alph) without forcing a multipart message.

Failing that, you may be better off investigating the use of the LANSA Integrator HttpService (specifically XMLOutboundService). LANSA Integrator also has good support for building and reading XML files. Unsure if you will require a license to use LANSA Integrator -- if it does, there will be a message in the Integrator Transport.txt file indicating that the feature you are trying to use is not licensed.
https://docs.lansa.com/15/en/lansa093/i ... 257C_____0

If you have not used LANSA Integrator before, it may be a good idea to contact your Local Services team for help.
Post Reply