Close

WS-Policy + Weblogic WebServer + Working

Finally a WS-Policy that worked. I was trying to do it in the JBOSS and Tomcat when a thought of using weblogic came to my mind. I used weblogic when it was in 7ish and 8ish versions but now it is in 10ish version. It grew up a lot :-D.

I’ve seen the whole workshop so simillar to Eclipse, I believe they use eclipse as their base environment and then integrate their own packages into it. When adding servers to your project, it even let you to add Tomcat servers, but no JBOSS (as I believe since JBOSS bought by Red Hat).

I used this helps / tutorials to do the simple project.

(-) http://ws.apache.org/commons/neethi/index.html

this called Neethi, API provided by the apache for using ws-policy with your web services. It is in 2.0.4th version.

http://edocs.beasys.com/wls/docs92/ConsoleHelp/taskhelp/webservices/ConfigureWSPolicyFile.html

This was the main help for me to associate a WS-Policy to a web service. Although it was for the 9th version but it helped a lot and I could figure out what to do. There were some minor changes in steps that I think anyone can get it while reading that.

http://localhost:7001/console/console.portal?_nfpb=true&_pageLabel=AppApplicationSecurityPage&AppApplicationRolesPortlethandle=com.bea.console.handles.AppDeploymentHandle(%22com.bea%3AName%3DtestWSEAR%2CType%3DAppDeployment%22)

This was  the place  that I added policies to the service, the policy is so simple that answer a request in specific time (e.g 2:30:00 PM to 3:00:00PM) and if not in that time the service called the answer would be something like this :

env:Client.Authentication
Access Denied to operation getCustomers

weblogic.wsee.util.AccessException: Access Denied to operation getCustomers
at weblogic.wsee.security.AuthorizationHandler.handleRequest(AuthorizationHandler.java:62)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:123)
at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:85)
at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:80)
at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.java:66)
at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java:44)
at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseWSServlet.java:257)
at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3395)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

http://edocs.beasys.com/wls/docs92/ConsoleHelp/taskhelp/webservices/ViewInstalledWebServices.html

with the help of this you can see your web services deployed on your application server.

The nice thing about weblogic server I came up with was the lock & edit function, you could lock in your current status of server, do the changes and when everything satisfactory you are able to assign the changes to the server and services running.

1 thought on “WS-Policy + Weblogic WebServer + Working

Leave a Reply to June Faster Cancel reply

Your email address will not be published. Required fields are marked *