Kbase P97130: How to enable authentication for WSDL with Tomcat
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/21/2005 |
|
Status: Unverified
GOAL:
How to enable authentication for WSDL with Tomcat
GOAL:
How to make sure the authorization for WSDL is enabled
FACT(s) (Environment):
OpenEdge 10.x
Web Services
Tomcat 4.1
FIX:
See below the steps fo follow in order to enable authentication for WSL:
1- Create a role myRole and grant the user myUser in Tomcat
Edit the file tomcat-users.xml located in the directory [Tomcat directory]\conf, and add the entry:
<role rolename="myRole"/>
<user username=myUser" password="myPWD" roles="myRole/>
2- Enable security constraint on WSDL in the web.xml file (located in [Tomcat Directory]\webapps\wsa\WEB-INF\):
Uncomment the <security-constraint> element for the URL path for WSDL, and replace the 'entry enter_jse_role_name' by the new role created in step #1, that is 'myRole'.
<security-constraint>
<web-resource-collection>
<web-resource-name>wsa1 WSDL Access</web-resource-name>
<url-pattern>/wsa1/wsdl/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>myRole</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
3- Modify the WSA instance's properties in the file ubroker.properties located in [OpenEdge Directory]\properties, and enable authorization for WSDL:
[WSA.wsa1]
wsdlAuth=1
4- Start the OpenEdge AdminServer and TomCat
5- Check from your favorite browser that the security is enabled.
<Host name>:<port number>/wsa/wsa1/wsdl
Enter the user name 'myUser' and password 'myPWD'. The WSDL listing page should then appear.
6- Run the following code from the Procedure Editor:
DEFINE VARIABLE hWebService AS HANDLE NO-UNDO.
DEFINE VARIABLE bOk AS LOGICAL NO-UNDO.
CREATE SERVER hWebService.
bOk = hWebService:CONNECT("-WSDL 'http://localhost:8080/wsa/wsa1/wsdl?targetURI=urn:simple'
-WSDLUserid 'myUser'
-WSDLPassword 'myPWD'
-Service wsTestService
-Port wsTestObj").
MESSAGE bOk VIEW-AS ALERT-BOX INFO BUTTONS OK.
The message 'Yes' should appear.