Hi Nandana,
Thank you very much for the prompt response.
Yes, I was getting the exception on the client side. Adding an axis2.xml to
the ConfigurationContext solved it. However, I am getting a
NoSuchMethodError when calling the requestSecurityToken operation on a
STSClient object. I am posting the stack traces:
[[Client Side]]
Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.ws.security.message.WSSecHeader.isEmpty(Lorg/w3c/dom/Document;)Z
at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:145)
at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java
:64)
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.send(AxisEngine.java:377)
at org.apache.axis2.description.OutInAxisOperationClient.send(
OutInAxisOperation.java:374)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
OutInAxisOperation.java:211)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java
:163)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java
:528)
at org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java
:132)
[[Service Side]]
java.lang.NullPointerException
org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:170)
org.apache.rampart.RampartEngine.process(RampartEngine.java:72)
org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java
:91)
org.apache.axis2.engine.Phase.invoke(Phase.java:292)
org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(
RESTUtil.java:125)
org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(
RESTUtil.java:119)
org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest
(AxisServlet.java:799)
The client code for the RST/Issue call consists of:
//---
stsClient.setRstTemplate(getRequestSecurityTokenTemplate(serviceEndpoint));
stsClient.setAction(RahasConstants.WST_NS_05_02 +
RahasConstants.RST_ACTION_ISSUE);
// blocking request: retrieve token from the STS response message
Token responseToken = stsClient.requestSecurityToken(servicePolicy,
stsEndpoint, stsPolicy, serviceEndpoint);
//---
The code above works perfectly fine for Rampart release 1.3. Let me know if
you have an idea of what's going on.
Thanks and regards,
Joana Trindade
On Thu, Feb 21, 2008 at 11:13 AM, Nandana Mihindukulasooriya <
[EMAIL PROTECTED]> wrote:
> Hi Joana,
> We had a long discussion [1] about this in the axis2-dev list
> and we decided to go on like this until dynamic phase support is
> implemented in Axis2. Once dynamic phase support is implemented, we
> won't have to go though all these hassle. I have sent a mail [2] about
> this to rampart-dev sometime back.
> Are you getting the exception in the client side ? If you don't
> specify an axis2.xml when creating a configuration context, Axis2 uses
> a file called axis2_default.xml in the Axis2 kernel and in Axis2 1.3 ,
> Security Phase is not there in the OutFaultFlow. So we have to pass a
> modified a axis2.xml when creating the configuration context.
>
> thanks,
> /nandana
>
>
> [1] - http://marc.info/?t=119746279500013&r=1&w=2
> [2] -
> http://mail-archives.apache.org/mod_mbox/ws-rampart-dev/200801.mbox/browser
> [3] -
> http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/axis2_default.xml?view=log
>
> On Tue, Feb 19, 2008 at 10:07 PM, Joana M. F. Trindade
> <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I thought adding the Security phase to OutFaultFlow would solve the
> issue,
> > but it did not. I am still getting the PhaseException, even though the
> > Security phase is now defined in my axis2.xml config file. Please let
> me
> > know what I am doing wrong. Here are the phases defined in
> > $AXIS2_HOME/WEB-INF/conf/axis2.xml:
> >
> > <phaseOrder type="InFlow">
> > <!-- System predefined phases -->
> > <phase name="Transport">
> > <handler name="RequestURIBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
> > <order phase="Transport"/>
> > </handler>
> > <handler name="SOAPActionBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
> > <order phase="Transport"/>
> > </handler>
> > </phase>
> > <phase name="Addressing">
> > <handler name="AddressingBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.AddressingBasedDispatcher">
> > <order phase="Addressing"/>
> > </handler>
> > </phase>
> > <phase name="Security"/>
> > <phase name="PreDispatch"/>
> > <phase name="Dispatch" class="
> org.apache.axis2.engine.DispatchPhase
> > ">
> > <handler name="RequestURIBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
> > <handler name="SOAPActionBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
> > <handler name="RequestURIOperationDispatcher"
> > class="
> > org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
> > <handler name="SOAPMessageBodyBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
> >
> > <handler name="HTTPLocationBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
> > </phase>
> > <phase name="RMPhase"/>
> > <!-- System predefined phases -->
> > <!-- After Postdispatch phase module author or service author
> can
> > add any phase he want -->
> > <phase name="OperationInPhase"/>
> > <phase name="soapmonitorPhase"/>
> > </phaseOrder>
> > <phaseOrder type="OutFlow">
> > <!-- user can add his own phases to this area -->
> > <phase name="soapmonitorPhase"/>
> > <phase name="OperationOutPhase"/>
> > <!--system predefined phase-->
> > <!--these phase will run irrespective of the service-->
> > <phase name="RMPhase"/>
> > <phase name="PolicyDetermination"/>
> > <phase name="MessageOut"/>
> > <phase name="Security"/>
> > </phaseOrder>
> > <phaseOrder type="InFaultFlow">
> > <phase name="Addressing">
> > <handler name="AddressingBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.AddressingBasedDispatcher">
> > <order phase="Addressing"/>
> > </handler>
> > </phase>
> > <phase name="Security"/>
> > <phase name="PreDispatch"/>
> > <phase name="Dispatch" class="
> org.apache.axis2.engine.DispatchPhase
> > ">
> > <handler name="RequestURIBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
> > <handler name="SOAPActionBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
> > <handler name="RequestURIOperationDispatcher"
> > class="
> > org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
> > <handler name="SOAPMessageBodyBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
> >
> > <handler name="HTTPLocationBasedDispatcher"
> > class="
> > org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
> > </phase>
> > <phase name="RMPhase"/>
> > <!-- user can add his own phases to this area -->
> > <phase name="OperationInFaultPhase"/>
> > <phase name="soapmonitorPhase"/>
> > </phaseOrder>
> > <phaseOrder type="OutFaultFlow">
> > <!-- user can add his own phases to this area -->
> > <phase name="soapmonitorPhase"/>
> > <phase name="OperationOutFaultPhase"/>
> > <!--system predefined phase-->
> > <phase name="RMPhase"/>
> > <phase name="PolicyDetermination"/>
> > <phase name="MessageOut"/>
> >
> > <!-- Joana, 19.02.2008, added for rampart -->
> > <phase name="Security"/>
> > </phaseOrder>
> >
> >
> > Thanks and Regards,
> > Joana
> >
> >
> >
> > On Feb 19, 2008 3:08 PM, Joana M. F. Trindade <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hi all,
> > >
> > > There is a incompatibility issue between the rampart trunk version
> and
> > > Axis2 1.3 binary distribution. In this distribution, the Security
> phase is
> > > only enabled on the Inflow, Outflow, and InFaultFlow phase orders.
> Rampart
> > > trunk version adds a handler to the Security phase on OutFaultFlow,
> as can
> > > be seen in the module.xml from rampart-SNAPSHOT.mar:
> > >
> > > <OutFaultFlow>
> > > <handler name="PolicyBasedSecurityOutHandler" class="
> > > org.apache.rampart.handler.RampartSender">
> > > <order phase="Security" phaseLast="true" />
> > > </handler>
> > > </OutFaultFlow>
> > >
> > > This causes a PhaseException [1] in the Axis2 engine. In order to fix
> > > this, one has to manually add the Security phase to the OutFaultFlow
> in
> > > axis2.xml ($AXIS2_HOME/WEB-INF/conf). I'm not part of the Axis2
> mailing
> > > lists, but perhaps it would be interesting to let them know about it,
> and
> > > enable the Security phase by default in OutFaultFlow.
> > >
> > > Thanks and regards,
> > > Joana
> > >
> > > [1] - org.apache.axis2.phaseresolver.PhaseException: Did not find the
> > > desired phase 'Security' while deploying handler
> > > 'PolicyBasedSecurityOutHandler'.
> > >
> > > --
> > > Student Intern
> > > SAP Research - Security & Trust
> > > SAP Labs France
> > >
> > > 805 Avenue du Dr. Maurice Donat
> > > 06250 Mougins
> > > T +33/492286319
> > > F +33/492286201
> > > Personal Homepage:
> > http://www.inf.ufrgs.br/~jmftrindade<http://www.inf.ufrgs.br/%7Ejmftrindade>
> <http://www.inf.ufrgs.br/%7Ejmftrindade>
> >
> >
> >
> >
> >
> >
> > --
> > Student Intern
> > SAP Research - Security & Trust
> > SAP Labs France
> >
> > 805 Avenue du Dr. Maurice Donat
> > 06250 Mougins
> > T +33/492286319
> > F +33/492286201
> > Personal Homepage:
> > http://www.inf.ufrgs.br/~jmftrindade<http://www.inf.ufrgs.br/%7Ejmftrindade>
> >
>
> http://nandana83.blogspot.com/
> http://nandanasm.wordpress.com/
>
--
Student Intern
SAP Research - Security & Trust
SAP Labs France
805 Avenue du Dr. Maurice Donat
06250 Mougins
T +33/492286319
F +33/492286201
Personal Homepage: http://www.inf.ufrgs.br/~jmftrindade