Some changes have been made today to dedicated services that will probably break your RUI applications. Please read this if you use the nightly builds, otherwise this won't pertain to you until the next milestone is released.
The call statement was updated not too long ago to support a new "using" clause, where you specify a variable that tells the call how to reach the service. A new type "HttpProxy" has been added to the system parts which you can specify for the using clause when invoking a dedicated service. The DedicatedService annotation has been removed, and you must now use the using clause, passing in an HttpProxy.
call serviceVariable.functionName() returning to handleResponse onException serviceExceptionHandler;
New syntax (two usages):
When referencing a service part the HttpProxy doesn't need anything set in the variable:
call MyService.functionName() using new HttpProxy returning to handleResponse onException serviceExceptionHandler;
When referencing an interface part you must specify the implementation name:
http HttpProxy = new HttpProxy("server.MyService");
call IMyService.functionName() using http returning to handleResponse onException serviceExceptionHandler;
Here's the wiki page about service access (feel free to fill in any gaps!): wiki.eclipse.org/ EDT:Accessing_a_service (delete the space character, the forum won't allow me to post links)
I just upgraded to 0.8.0 from 0.7.0 (where my code was working) and ran into the dedicated service problem. I've been making corresponding changes in my "service" and in my "client" code to keep up with the upgrade. I believe I am following your instructions properly. Perhaps not.
My service (NewDBService) declares an SQLDataSource (now using 0.8.0 syntax), and has some functions using that data source. My revised Rich UI Client calls one of the functions in the NewDBService as follows:
call NewDBService.createDefaultTable() using new HttpProxy returning to myfun
I see a run time error when I preview:
[CRRUI3664E] An EGL service is being invoked in a dedicated fashion but no service name has been supplied.
[CRRUI2094E] Here are the EGL function calls leading to this error:
handlers/MainClient.egl() at line 51
(line 51 is the line above). Any ideas on how to proceed would be greatly appreciated.
Hi. Your revised call syntax looks correct to me. I tried invoking a Dedicated Service two different ways, and it seems to be working for me. For example:
// Create and bind an instance of our service.
srvConnection HttpProxy = new HttpProxy("gallery.sayhelloservice.SayHelloService");
//use existing connnection
call SayHelloService.hello(name) using srvConnection returning to serviceCallback onException handleError;
//use anonymous connection
call SayHelloService.hello(name) using new HttpProxy returning to serviceCallback onException handleError;
Can you try invoking your service with an "existing connection" and see if you get the same message again?
Are you seeing this error message in the Preview pane, or in the deployed version of the application?
Is the Service located in the same project, or in a different project? My example had the Service located in the same project.
Also, what version of EDT .8 did you install? I am working with the latest version of the code from CVS, which would represent the latest Nightly build.
o I am seeing the message when trying to Preview the app. I have not tried deploying.
o The service and client are in different projects in my case. The service project is in the build path for the client project.
o I got the software by doing "Install Software" from
download.eclipse.org/edt/milestones/1.0/ -- I seem to have:
I could use the latest build if there's evidence it would help.
o If by "use existing connection" you mean declaring the HttpProxy separately, I have tried that. Same error.
I tried splitting my simple example up into two projects, and I am having issues loading the service, but I am not getting the same message as you. I am going to investigate this a bit further, but will most likely open a bug so that the appropriate team members can determine what is happening. If I open a bug, I will post the number here.
Also, if you have a chance, it would be good to know if you still have an issue if the application is deployed.
I have been experiencing the same problem. However, i believe I have found a solution. When the service is in a separate project to the client what I found was that by defining the SQL Database Binding in the client project as well as the Service project this resolved the issue.
It seems that the error message is a little misleading.
When you do not specify the deployment descriptor file in your binding (such that it uses the default), a dedicated service will use the default deployment descriptor specified on the *RUI* project, not the project containing the service. This is to simulate how a deployed application would behave.
A REST service invocation would use the default deployment descriptor specified on the project containing the service.
I tried this scenario out and got an error message that indicated it was looking in the RUI project's DD for the binding. What was the message you were seeing?