Error doing a POST request Omnis 8.1.3
Bruno Del Sol
bruno.delsol at bydesign.fr
Wed Jan 10 05:49:28 EST 2018
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
http://www.bydesign.fr
Bruno Del Sol
bruno.delsol at 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 <http://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 http://lists.omnis-dev.com
More information about the omnisdev-en
mailing list