Ok..good to know that you have been through the tutorials. You are asking how to create a service, so I was referring to only that part of the tutorials. How you access a "java" service from a native JavaScript or JSP is the client side and that is based on the tools you are using to "consume" the service. The EGL tutorials focus on EGL RUI's consuming them, but any client that can consume web services can use EGL SOAP services and I believe as REST services (still waiting on feedback).
You also asked how to turn a library into a service.
Structurally they are identical. Meaning.
library mylibrary
myglobalvar char(3);
function func1 (var1 type)
// statements
end
function func2 (var1 type) returns(type)
// statements
end
end
service myservice
myglobalvar char(3);
function func1 (var1 type)
// statements
end
function func2 (var1 type) returns(type)
// statements
end
end
The difference in behavior that I can think of are:
a.) The service can be invoked from a remote (web service) client. Libraries cannot
b.) In a library, the global variables (defined outside the functions) are directly accessible from the "caller" (e.x. mylibrary.myglobalvar = "AAA" in the JSF Handler. Service global variables are not accessible except inside the service.
c.) Services can return an exception in the client if the service invocation fails.
d.) Services need service deployment information which is contained in the .egldd file
So, you "should" be able to do the following to convert them:
- Change the "type" from "library" to "service"
- Create an .egldd file in the web project (if not already there).
- Add service deployment entries to the .egldd for the services you want to expose.
- Create WSDL for the SOAP services (from the context menu).
- Change the build descriptors used to generate the java to specify the service runtime
- If you were expecting global variables to be accessed, you will probably have to imbed them with an invokable function rather than direct access
- You need to generate the service parts AND the .egldd file.
You may also have to create a new web project and copy the source you want to convert into it. Sometimes it helps to start with a new web project already targeting the application server you want to deploy to.
hope this helps.
Mark
p.s. I will be on holiday for a couple of weeks, so my responses may be slow.
markevans