Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[edt-dev] You picked up the latest build and your service invocation interfaces have errors - Read this

This is probably related to Bugzilla enhancement 378384. The goal of this enhancement was as it states to normalize the use of the call statement for service invocations and calling IBMi host programs.
There are a few parts to the change:
  1. First the part that didn't change. If you are using the syntax of call <Service part>.function .... this is still supported. We have only change <Interface part>.function. ie:
    call HelloWorld.hello1("Joe") using new HttpProxy returning to handleResponse;
    Where HelloWorld is the service part, the using clause could be an HttpProxy or HttpRest object.
  2. Interface functions are no longer used a a place to define a service end point. Now interfaces are only used to define function signatures. Service end point definitions are defined on library or handler functions. The generator will use these functions as a place to generate the code to access the service.
  3. GetRest, DeleteRest, PutRest, PostRest annotations have been combined into a single Rest annotation with a method that = GET, DELETE, POST, or PUT.

So how do you fix the errors...
First true REST services, you have something like:
        interface IData
                function getDataByID( id string in) returns (Data){
                        @GetRest {
                                uriTemplate="http://host1:9080/org/v0/data/{id}/",
                                requestFormat=Encoding._FORM,
                                responseFormat=Encoding.XML
                        }
                };
                function deleteData( id string in){
                        @DeleteRest {
                                uriTemplate="http://host1:9080/org/v0/data/{id}/"
                        }
                };
        end
change it to:
        library IData
                function getDataByID( id string in) returns (Data){
                        @Rest {
                                method = HttpMethod._GET,
                                uriTemplate="http://host1:9080/org/v0/data/{id}/",
                                requestFormat=Encoding._FORM,
                                responseFormat=Encoding.XML
                        }
                }
                end
                function deleteData( id string in){
                        @Rest {
                                method = HttpMethod._DELETE,
                                uriTemplate="http://host1:9080/org/v0/data/{id}/"
                        }
                }
                end
        end

If you are invoking an EGL service using an Interface you had:
                interface IHelloWorld
                        function hello1(p string inout);
                        function hello2(p string in)returns(string;
                end
You need to change the interface to a library or handler and add an annotation to each function:
                handler IHelloWorld
                        function hello1(p string inout){@EglRestRpc {}};
                        function hello2(p string in)returns(string){@EglRestRpc {}};
                end

regards,
Joe Vincens
EGL Developer
Rational Software, IBM Software Group
150 Kettletown Road, Southbury, CT  06488, USA

Back to the top