Error doing a POST request Omnis 8.1.3

An an.bayens at justsoftware.be
Wed Jan 10 07:42:09 EST 2018


Hi Kelly,

I don't now how this happend but in the my code there is no such thing as het <http://.... <http://..../>>. Something happend there when I copy pasted it.
I've tried it with http in front but that still doesn't work.

Anybody else some ideas?

Met vriendelijke groeten,
An Bayens
Product Manager



> Op 10 jan. 2018, om 11:47 heeft Kelly Burgess <kellyb at montana.com> het volgende geschreven:
> 
> I'm just guessing, but when I see your code
> 
>    <PastedGraphic-39.png>
> 
> I wonder if you should try changing that one line to
> 
>    Calculate iURL as 'xando.channelengine.net'
> 
> leaving out the space and the repeated url in <brackets>.  That would make iURI start as 'xando.channelengine.net/thisAPI?apikey=' …
> 
> If that didn't work, I'd add the leading 'http://' <http://'/> protocol prefix ahead of the xando.channelengine.net <http://xando.channelengine.net/>.  I haven't used that restful object approach before, so I don't know for sure what the proper format for the first $init() parameter should be, but the bit inside <brackets> really looks out of place in a uri.
> 
> Good luck,
> 
> Kelly


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 <http://lists.omnis-dev.com/>


More information about the omnisdev-en mailing list