Hi Ruchith,
Thanks for proving the class. I am assuming that I needed to add this handler
to the transport phase after SOAPActionBasedDispatcher. I was able to find the
wso2 dependencies from wso2wsas version 2.3. and able to compile the class by
using wso2wsas-core-2.3.jar and wso2utils-2.2.jar files. But I am having
trouble when I run it. The program depends
javax.servlet.http.HttpServletRequest and
javax.servlet.http.HttpServletResponse classes and they are available in
servlet-api.jar in standard tomcat 6.0.18. But for some reason I get this error.
SEVERE: StandardWrapper.Throwable
java.lang.Error: Unresolved compilation problems:
The import javax.servlet.http cannot be resolved
The import javax.servlet.http cannot be resolved
HttpServletRequest cannot be resolved to a type
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpServletResponse cannot be resolved
at
org.wso2.wsas.security.pox.POXSecurityHandler.<init>(POXSecurityHandler.java:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
I tried unzipping the servlet-api.jar in classes dir and got this error.
SEVERE: Servlet /axis2 threw load() exception
java.lang.ClassCastException: org.apache.axis2.transport.http.AxisServlet
cannot be cast to javax.servlet.Servlet
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1104)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
I would really appreciate any help. I am using axis2-1.4.1 with rampart 1.4.
Thanks
Sanjay
-----Original Message-----
From: Ruchith Fernando [mailto:[email protected]]
Sent: Thursday, April 16, 2009 5:52 PM
To: [email protected]
Subject: Re: Securing Axis2 REST Style Services
Oops :-)
Here you go :
https://wso2.org/repos/wso2/branches/wsas/java/2.2/wsas/java/modules/core/src/org/wso2/wsas/security/pox/POXSecurityHandler.java
On Thu, Apr 16, 2009 at 8:36 PM, Sanjay Gupta
<[email protected]> wrote:
> Hi Ruchith,
> Thanks for the quick reply. Could you please point me to the link that talks
> about this solutions.
> Thanks
> Sanjay
>
> -----Original Message-----
> From: Ruchith Fernando [mailto:[email protected]]
> Sent: Thursday, April 16, 2009 4:31 PM
> To: [email protected]
> Subject: Re: Securing Axis2 REST Style Services
>
> Hi,
>
> For the REST style calls you can use HTTPS + Basic Auth
>
> Have a look at this [1] handler from WSO2 WSAS. This will simply add
> the UsernameToken into the SOAP representation of the incoming REST
> request, which will be processed by Rampart (which you have already
> configured).
>
> Thanks,
> Ruchith
>
> On Thu, Apr 16, 2009 at 3:04 PM, Sanjay Gupta
> <[email protected]> wrote:
>> HI,
>>
>> I have a POJO based services deployed in axis2 and it's working well. I have
>> implememted the basic user/password security using rampart and it's working
>> fine for SOAP calls. I generated the client using wsdl2java.My question is
>> how do I secure the REST style calls. Do I need to do anything special. I
>> need to deploy these services into production soon and any help or pointers
>> would be greatly appreciated.
>>
>> Thanks
>>
>> Sanjay
>
>
>
> --
> http://blog.ruchith.org
>
--
http://blog.ruchith.org