Consultor Eletrônico



Kbase P150680: How to publish your own OpenEdge Web Service
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/08/2009
Status: Unverified

GOAL:

How to publish your own OpenEdge Web Service

GOAL:

What are the steps to publish your own Web Service in OpenEdge

GOAL:

How to expose an AppServer procedure as a Web Service

GOAL:

How to use the Web Services Adapter (WSA)

FACT(s) (Environment):

OpenEdge 10.x
All Supported Operating Systems

FIX:

It is possible to publish your own Web Service using OpenEdge. The Web Service Adapter (WSA) has been designed for this purpose and is a Java based solution which requires a Java Servlet Engine (JSE) to work. The WSA can be managed via the Progress Explorer tool or via the WSAMAN command-line utility. This Solution will only discuss the Progress Explorer as a means of managing the WSA. For further details and proper syntax for the WSAMAN utility, please refer to the "OpenEdge Application Server: Administration" documentation.
There are a couple of steps which are required to publish your own Web Service. The general steps are as follows (with an example where possible):

Configure the WSA with a JSE of your choice (Tomcat being the most commonly used):

P30600, "How to setup the Web Services Adapter (WSA) with Tomcat on a Windows Platform"
P72685, "How to configure the WSA with ServletExec Servlet Engine 4.x as a Web application"
P92996, "How to setup Macromedia JRun 4 with the sample Web Services Adapter (WSA)"


Develop an AppServer application which you would like to publish as a Web Service. For example:

/* roundtrip.p */
DEFINE INPUT PARAMETER ipcText AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER opcText AS CHARACTER NO-UNDO.
opcText = ipcText + "- Ok!".
/* end */


Note: The WSA requires an AppServer to function properly. When using the WSA, State-Free is the recommended Operating Mode for an AppServer. In this example we will also make use of a NameServer, so make sure it's started and that the AppServer has registered itself with the NameServer.


Compile your AppServer application to get the r-code, e.g.: roundtrip.r


Generate the Web Service Mapping (WSM)
Using the r-code from the AppServer application, generate the Web Service Mapping (WSM) file through the Proxy Generator (ProxyGen). The WSM maps the Progress 4GL procedures that run on an AppServer so they are readily callable from any client that can access a standard Web Service, e.g.:

- Open the Proxy Generator.
- Choose File / New from the menu.
- On the AppObject tab enter "WSTest".
- Click on the "New" button next to the "Propath Components" section.
- Choose the directory where your AppServer application r-code is located.
- Choose Procedure / Add / Non-persistent from the menu.
- Add roundtrip.r
- Choose File / Generate from the menu.

- In the General tab only select "Web Services".
- Uncheck the "Use Default" option and enter the name of your AppServer in the "AppService" field.
- Enter the directory where you want the WSM to be output in the "Output Dir" section.

- Go to the Web Services tab.
- Enter a Namespace for your Web Service.
- Enter the "URL for the WSA" which was configured in step 1.
- Choose "Free" for the Session Model.
- Choose "Document/Literal" in the WSDL Settings.
- Click on "OK" to generate the WSM file.


Deploy and enable your Web Service by using the WSM file created by the ProxyGen, e.g.:

- Open the Progress Explorer tool and connect to the AdminServer.
- Expand the Web Services Adapter node.
- Right-click on "wsa1" and choose Status.
- This should return a message saying that the WSA is running.

- Right-click on "wsa1" and choose Properties.
- Go to Security and make sur.e "Enable Web Services" is checked.
- Also make sure "Enable WSA Administration" is checked.
- Restart your JSE if you made any changes here.

- Expand "wsa1".
- Right-click on the "Web Services" node and choose "Deploy A New Web Service".
- Select the WSM file which was created earlier by ProxyGen.
- Your Web Service (WSTest) should now be displayed as a child node.
- Right-click on WSTest and choose Enable.
To verify that your Web Service is available, access its WSDL document through the WSA URL, e.g.: http://localhost:8080/wsa/wsa1/wsdl? shows all deployed Web Services. You can now use the WSDL document to access your Web Service from a Web Service client..