Error doing a POST request Omnis 8.1.3
Hi Bruno,
Thanks for the answer, that was indeed the solution.
Met vriendelijke groeten,
An Bayens
Product Manager
Stationsstraat 266, B-1700 Dilbeek
T. +32 2 567 21 71
Helpdesk: +32 2 568 14 54
an.bayens@optimizegroup.be <mailto:an.bayens@optmizegroup.be>
www.justsoftware.be <www.justsoftware.be/> | www.optimizegroup.be <www.optimizegroup.be/>
> Op 10 jan. 2018, om 11:49 heeft Bruno Del Sol <bruno.delsol@bydesign.fr> het volgende geschreven:
>
> Hi An,
>
> You are using the “old” http client which has a dependency with Java.
>
> With 8.1.3, you should rather user the new OW3 worker object, which doesn’t have this flaw.
>
> Have a look at the library at Hub / Samples / HTTP OW3 worker object for a working example of POST request
>
> Regards
> Bruno
>
>
> By Design
> www.bydesign.fr <www.bydesign.fr/>
> Bruno Del Sol
> bruno.delsol@bydesign.fr <mailto:bruno.delsol@bydesign.fr>
> tel (33) 01 48 78 47 37
> 46, rue de La Tour d’Auvergne
> 75009 Paris (France)
>
> Le 10/01/2018 à 11:21, An a écrit :
>> Hi all,
>>
>> I’m having a problem with Omnis 8.1.3 with doing a POST request in JSON. I get the error that the Java Native Interface couldn’t be initilalized.
>>
>> This is what I do in my code:
>>
>> Do method $BuildListHeader (‘POST’)
>>
>> Calculate iURL as ‘xando.channelengine.net <xando.channelengine.net/> <xando.channelengine.net/ <xando.channelengine.net/>>’
>>
>> Calculate iURI as con(iURL,’/’,iAPIname,’?apikey=’,ivChannelEngineApiKey)
>>
>> Do iRestfulObj.$init(iURI,kOWEBhttpMethodPost,iListHeaders,iContentBinary)
>> Do iRestfulObj.$run() Returns lStatus
>> If lStatus
>> Do iRestfulObj.$returnJSON(iResponseHeaders,iRowResponse,iRowJSON) Returns iJSONString
>> Calculate msg as con(iAPIname,’ ‘,iRowJSON.code,’ ‘,iRowJSON.object.$colcount)
>> Else
>> Calculate msg as iRestfulObj.$errortext
>> End If
>> If iRowResponse.httpStatusCode>=200&iRowResponse.httpStatusCode<=209
>> Calculate ok as kTrue
>> Else
>> Calculate msg as con(iAPIname,’ ‘,iRowResponse.errorCode,’ ‘,iRowResponse.errorInfo,’ ‘,iRowResponse.httpStatusCode,’ ‘,iRowResponse.httpStatusText)
>> Calculate ok as kFalse
>> End If
>> If iRowJSON.code<>‘200’
>> Do iListResponseCodes.$search($ref.C1=iRowJSON.code,kTrue,kFalse,kFalse,kFalse)
>> Calculate msg as con(iAPIname,’ ‘,iRowJSON.code,’ ‘,iListResponseCodes.description)
>> Calculate ok as kFalse
>> End If
>> Quit method ok
>>
>> The result of the iRestfulObj.$run is an error which is Java Native Interface couldn’t be initilalized.
>>
>> Thanks in advance.
>>
>> Met vriendelijke groeten,
>> An Bayens
>> Product Manager
>>
>> _____________________________________________________________
>> Manage your list subscriptions at lists.omnis-dev.com <lists.omnis-dev.com/>
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com