Web Services Exposure

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Web Services Exposure

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:42 pm

by Brian Mills >> Thu, 4 Nov 2004 23:22:36 GMT

I'm using web services to use a Jade database in a variety of interfaces. My problem is really the way you define the exposure of complex types in Jade. And the way the primitive types get returned in some instances.

I have found the when returning a primitive type like a boolean or a timestamp that it doesnt always return it in a useable form. I've found the timestamp for instance returns 2004-10-21T12:03:24-00:00. Which doesnt seem recongnisable to one of the .Net applications that is trying to understand it as a timestamp using the built in Webservices reference/understander. What I would like to do is override how some of these primitive types get returned as strings. Is there a way in Jade to override the default way?

My second problem is to do with the exposure of complex types. I would actually like to modify what gets returned on a method by method basis. The reason is that I have one web call which will rerurn a collection of objects for display in a search. In this instance we only need a small subset of the information available on the total object. Then when we click on one of those objects (a person object) we need all the information associated with them so we can display and edit all the information associated with them. I'm trying to work out an easy way not to return all the data associated with the person for the search as its quite unnessisary.

Any thoughts anyone?

Brian.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Web Services Exposure

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:42 pm

by Stephen >> Thu, 18 Nov 2004 2:16:10 GMT

I'm keen to find out about this to - Does no one have a solution?
Like Brian, I am wanting to return only part of an object on one method call, and the further details on a subsequent call. In our case it is for tenders. A search on tenders would return only basic info such as tender number, title and closing date. Then if they request it, we would give the full details. But I can not see a way to do this. The only way I can figure is to create transient instances of an all new class, with only the few properties that I want to expose for that particular method call. But that's pretty ugly..... Has anyone figured out a way to do this nicely?

I am also having trouble with exception handling within WebSessions. At the moment any exception that occurs, returns the error to the browser OK (I am using the testing interface provided via a browser), but the WebService window just freezes. At the moment just CardSchemas global exception handler is armed.
I am having trouble arming my own exception handler too. On the create method of my JadeWebServiceProvider class I arm an exception handler, but this doesn't get called when the exception occurs. I have tried it on the global::getAndValidateUser method, but it also doesn't get called.
I also tried putting just a simply write "delete"; statement on the delete method of my JadeWebServiceProvider class, which is called for every request OK, until an exception occurs, when it is not called. So something is not tidying up properly. It does it too on the Erewhon sample app.
How are others arming exception handlers for WebSessions???

Thanks
Stephen

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Web Services Exposure

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:42 pm

by brian.mills >> Sun, 21 Nov 2004 22:00:20 GMT

I've got the same problem with exception handeling. I havent found a way to get it to work at all.

On the searching, at the moment i'm creating transients of a different class that have the properties that I want to expose on the search. And I only return the top 20 results and a number of total results to prevent it being too slow to return. I think it's messy, but it does work at this point.

Brian.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Web Services Exposure

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:42 pm

by Darrell Duniam >> Sun, 21 Nov 2004 22:25:58 GMT

Regarding the exception handling, we have done the following:

o each method on the Web Service Provider class has an io parameter which returns an error message (or null);

o each method on the Web Service Provider class arms a local exception handler, passing the error message parameter to the handler. The handler sets the error message parameter, then does a "return Ex_Resume_Next";

o the methods on the provider class can then check whether the error message parameter is null before proceeding to do something.

For example:

xHandlerInterface(pExceptionObj:Exception; pErrorMsg:String output):Integer protected;
vars
errorCode : Integer;
errorMessage : String;begin

errorCode := pExceptionObj.errorCode;
errorMessage := process.getErrorText(errorCode);

pErrorMsg := "Digital Imaging message failed with error '" &
errorCode.String & "' in remote database: " &
CrLf & CrLf & errorMessage;

return Ex_Resume_Next;
end;

.....and an example method from our Web Service Provider class:

getImage( pCountry:String; pProject:String; pChildID:String; pImageUniqueId:Integer; pErrorMsg:String io) : Binary webService;begin

on Exception do self.xHandlerInterface(exception, pErrorMsg);

return self.myInterfaceClass.getImage(pCountry, pProject, pChildID, pImageUniqueId, pErrorMsg);
end;

regards,
darrell.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Web Services Exposure

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:42 pm

by Anonymous >> Wed, 13 Apr 2005 1:36:09 GMT

Hi Darrell,

I'm getting back into this web service exception problem again. Jade needs to do something about this. Your sollution while it works, I consider it kind of a work arround. You should be able to throw an Web service excpetion (I believe class JadeSOAPException) and have it respond appropriatly as per the web services specification. the fact is it does work, however in my non gui application pops up the general exception dialog despite having a global exception handeler. Which then prevents the app from responding and closes the pipes. killing the application.

Frankly the web services implementation in Jade 6 has been a piece of crap. I've been involved in creating 4-5 hot fixes to the framework none of which I could do anything about untill they fixed them. I had no work arround. I'll get off my soap box now.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 12 guests

cron