Hi Ruchith, Thanks. Yes, I corrected the policy and it works fine now. Thanks for the rampart-75 fix as well. I will replace my local fix with yours from the repository. Regards, Murali
----- Original Message ---- From: Ruchith Fernando <[EMAIL PROTECTED]> To: [email protected] Cc: [EMAIL PROTECTED] Sent: Saturday, October 13, 2007 3:17:27 AM Subject: Re: Rampart throws NPE Hi Murali, The NPE was thrown because there was no SOAP header in the request SOAP envelope. I just fixed this [1]. However, IMHO the way you have specified policy doesn't seem to correct to me. An example where we use a SAML token to protect a message is available with WSO2 WSAS [2] - sts-sample. Please have a look at how we set the service policy in this sample. Thanks, Ruchith [1] http://svn.apache.org/viewvc?rev=584382&view=rev [2] http://dist.wso2.org/products/wsas/java/2.1/ Murali Krishnan wrote: > The services.xml file contents I had included appear wrong in the > earlier message. I have attached it in this mail. > > ----- Original Message ---- > From: Murali Krishnan <[EMAIL PROTECTED]> > To: [email protected] > Cc: [EMAIL PROTECTED] > Sent: Wednesday, October 3, 2007 2:19:56 PM > Subject: Rampart throws NPE > > I'm trying to call a simple service deployed in Axis2. I'm trying to > enforce that this service requires a SamlToken whenever it is called... > If I invoke this service with a soap request that doesn't have any > security headers, I get the below exception at the server. If I > disenagage 'rampart' for the service, there is no problem. Am I doing > anything wrong in this scenario? > > Thanks, > Murali > > java.lang.NullPointerException > at org.apache.rampart.RampartEngine.process(RampartEngine.java:90) > at > org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:85) > at org.apache.axis2.engine.Phase.invoke(Phase.java:292) > at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132) > at > org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275) > at > org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > The soap request is like this: > > POST /axis2/services/SimpleService HTTP/1.1 > Content-Type: text/xml; charset=UTF-8 > SOAPAction: "urn:echo" > User-Agent: Axis2 > Host: 127.0.0.1:8888 > Content-Length: 244 > > <?xml version='1.0' encoding='UTF-8'?> > > <soapenv:Body> > > <name>Hello world</name> > </ns1:echo> > </soapenv:Body> > </soapenv:Envelope> > > > The services.xml is like this below: > > <service name="SimpleService"> > <parameter name="ServiceClass" > locked="false">com.softwareag.ws.SimpleService</parameter> > <operation name="echo"> > <messageReceiver > class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/> > </operation> > <operation name="add"/> > > <module ref="rampart"/> > <!-- <module ref="addressing"/>--> > > > <wsp:ExactlyOne> > <wsp:All> > > > xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy" /> > </wsp:All> > </wsp:ExactlyOne> > </wsp:Policy> > </service> > > ------------------------------------------------------------------------ > Yahoo! oneSearch: Finally, mobile search that gives answers > <http://us.rd.yahoo.com/evt=48252/*http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC>, > not web links. > > > ------------------------------------------------------------------------ > Yahoo! oneSearch: Finally, mobile search that gives answers > <http://us.rd.yahoo.com/evt=48252/*http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC>, > not web links. > ____________________________________________________________________________________ Need a vacation? Get great deals to amazing places on Yahoo! Travel. http://travel.yahoo.com/
