omnisdev-en Digest, Vol 76, Issue 10

Paul Mulroney pmulroney at logicaldevelopments.com.au
Mon Aug 11 19:44:10 EDT 2014


Hi Rudolph

We purchased the Omnis Web Services component, and used the wizard to create a Web Services object that had the API calls to the web service we wanted to use.  It created this object with methods like $item() which was one of the calls we could make to the web service.

Below is a chunk of the code that we used.  Note that iJavaObj is an object reference that is created in the $construct by the wizard, and we use the test "iJavaObj.$iswebservice" to determine if it initialised properly.  iJavaObj is instantiated in the $construct of the object to point to the Java Jar file that the wizard compiled automatically.  In the $construct $iswebservice is set to kTrue.  If when we go to call it, that the value is not kTrue, then that means that the Java object didn't initialise properly, and all calls from that point onwards fails.

> Calculate vbIsWebService as iJavaObj.$iswebservice
> If isnull(vbIsWebService)
>    Calculate vsResult as "The java object failed to initialise properly."
> 
> Else If vbIsWebService<>kTrue
>    Calculate vsResult as "The java object failed to initialise properly."
> 
> Else
>    Do $cinst.$item(vrThisItem) Returns vlResponse
>    Do $cinst.$getlasterror Returns vsError
>    If vsError<>''     ;; An error occurred, log it!
>       Calculate vsResult as con('$item(pickup) returned ',vsError)
>    Else     ;; No error, test the returned result.
>       Calculate vlMethodResponse as vlResponse.1.C1
>       Calculate vlReturnPickupItemList as vlMethodResponse.1.C1
>       Do ilPickupItemList.$merge(vlReturnPickupItemList)
>       If vlReturnPickupItemList.$linecount=0     ;; Returned list was empty.  Maybe a comms error? Error at their end?
>          Calculate vsResult as '$item(pickup) returned an empty result.'
>       Else     ;; The returned pickup list wasn't empty.  All good!
>          Calculate vbDone as kTrue     ;; We're done
>       End If     ;; test returned pickup list
>    End If     ;; Call to Add to pickup item list
> End if

Hope this helps!

Regards,
Paul.



On 12/08/2014, at 12:00 AM, omnisdev-en-request at lists.omnis-dev.com wrote:

> Message: 4
> Date: Mon, 11 Aug 2014 12:12:57 +0000
> From: Rudolf Bargholz <rudolf at bargholz.ch>
> Subject: AW: O$5.2 - Omnis Web Services - debugging
> To: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
> Message-ID:
> 	<4fe4e9bd46d64cb394f8c02da32e3ffe at AMSPR06MB056.eurprd06.prod.outlook.com>
> 	
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi Paul,
> 
> How are you calling the web service? We call web service methods either directly on the client by opening the web service library on the client and then calling the remote task instace, or issue a HTTP POST/GET, but have also implemented the Studio Java interface to call web services. Of all methods the HTTP POST/GET works best with respect to the stability of the Omnis Server, but from your explanation below I was not able to determine what exactly your communication flow is.
> 
> Regards
> 
> Rudolf
> 
> -----Ursprüngliche Nachricht-----
> Von: omnisdev-en-bounces at lists.omnis-dev.com [mailto:omnisdev-en-bounces at lists.omnis-dev.com] Im Auftrag von Paul Mulroney
> Gesendet: Montag, 11. August 2014 10:06
> An: omnisdev-en at lists.omnis-dev.com
> Betreff: O$5.2 - Omnis Web Services - debugging
> 
> Hi $All,
> 
> Has anyone used Omnis Web Services as a client?  Have you had any problems with it?
> 
> We're using a Web Service to queue courier jobs, and it seems to run fine for a while, and then suddenly the object class that was created with the Web Services wizard doesn't seem to initialise properly, and all the calls to the web service return an empty list.
> 
> Our client has recently switched to a server setup, and all the users are running on the server with multiple copies of Omnis.  It seems that once it starts failing, it fails for all instances of Omnis.
> 
> I figured out how to enable java logging by creating a "log4j.properties" file, and putting it in the right place and restarting Omnis.  However, it doesn't seem to log any crashes or failures to initialise - it only seems to log data when the thing is actually working, and nothing when it doesn't! As you can imagine, that's not very helpful.
> 
> If Java fails to initialise inside Omnis, does it get logged anywhere?  If so, can anyone tell me where?
> 
> Setup is Windows Server 2008R2 standard (64 bit), SP1. Java 7 update 67 (32 bit version). Studio 5.2.2.
> 
> All advice gratefully received!
> 
> Regards,
> Paul.
> 
> 


"Expecting the unexpected makes the unexpected expected and the expected unexpected" (anonymous).
-- 
Paul W. Mulroney                                                   We Don't Do Simple Pty Ltd 
pmulroney at logicaldevelopments.com.au        Trading as Logical Developments
www.logicaldevelopments.com.au			   ACN 161 009 374 
Ph: +61 8 9458 3889						   86 Coolgardie Street
Fax: +61 8 9458 2169                       			   BENTLEY  WA  6102






More information about the omnisdev-en mailing list