Victor Fonseca
| ||||
PROGRESS SOFTWARE 78 Geraldo Flausino Gomes, 15th floor | Sao Paulo, SP | 04575-060 | Brazil PHONE +55 11 5508-3594 MOBILE +5511 98611 5276 |
Yes, there is a little bit of an echo :-). When a post is marked as an "answer", it is copied to the top of the thread so readers don't have to scroll all the way down, but it also stays in it's spot in chronological order. Therefore you will see the "answers" twice in the thread.
Flag this post as spam/abuse.
[/collapse]
What part are you trying to do outside of PDS? Are you looking to define the service itself or are you trying to build the .war from outside PDS?
Deployment to a live server is normally done by using export from PDS and placing the resulting .war in the web apps directory.It is actually possible to do, but not without rolling your own code or using a framework or toolset for it.
We use Julian's Maia toolset for generating ABL model classes which includes REST support : bitbucket.org/.../maia
The rest support is based on WebSpeed and not AppServer, but I am sure it could be tweaked to work with AppServer as well.
Being able to generate it from Ant (or any other system) would be really helpful. I'm sure those steps could be easily integrated in PCT, but I'd need to know how it works under the hood.
Maybe some technical background will help you choose the right path.
You could build the REST service's .war file easy enough with ANT, using the sources located in $DLC/rest/lib and $DLC/rest/server directories. However, that would be missing the REST service's description file(s) (.paar) that contains all of the Service Interface's definition for HTTP message parts, datatypes, defaults, and AppServer procedure/parameter mapping. Without theREST service description file, the .war file you generated with ANT will not function.
The generation of a REST service description file requires creating 4 (complex) .xml files with all of the interface definition information. That is the role that only PDS can play - which is to generate the REST service description file(s) from the .p/.cls sources (with their annotations) and PDS's REST mapper tool. Not something anyone could do in any reasonable amount of time manually, but PDS does in a matter of milliseconds. For automated build processes, release 11.3 introduced the 'restgen.bat' command line utility that allows you to generate the .war or REST service description file from a PDS REST project. But I think that utility does not solve what you want to do because it still requires you to develop using PDS.
In the final analysis, you will require PDS to create and deploy REST or Mobile services to access an AppServer.
I hope this information helps.
Hello Michael,
From what I understand, the build automation only needs to generate the .paar file. This is only during automated deployment that this file will be dropped in the REST adapter application (in $DLC/servlets), and configured to point to the correct appserver (among other things). Is that right ? I'll have a look at restgen, and how it can be wrapped in an ANT task.
I don't really care about modifying the REST services description within ANT, just building what is stored in the source code repository, and be able to deploy it automatically.
By the way, I just tried to execute restgen.bat on a test project, and I got :
Creating REST Service WAR file with [TestRESTService] at target C:\Progress\Work\OPENED~1.3\test.war
Exception in thread "main" java.lang.NoClassDefFoundError: com/progress/tools/caf/core/model/ILocation
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at com.progress.rest.tools.WARGenerator.createRESTServiceWarWrapper(WARGenerator.java:74)
at com.progress.rest.tools.WARGenerator.main(WARGenerator.java:342)
Caused by: java.lang.ClassNotFoundException: com.progress.tools.caf.core.model.ILocation
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 4 more
Probably just a classpath problem, but it's a plain 11.3.1 install, and running it from proenv 11.3.1
I'll have a look a bit later.
Gilles
We're looking at the error you are seeing now and hope to get back to you soon.
There seems to be an issue with the restgen.bat in 11.3.1, it works well in 11.3.2. If you could access 11.3.2 please upgrade to the latest version and give it a try.
Sorry to have to tell you but we have confirmed that release 11.3.1 requires a library change in the developer's studio, so to get resign.bat support you will have to update your development environment to 11.3.2 or later.
I will update to 11.3.2 and keep you posted, thanks.
Gilles