axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nandana Mihindukulasooriya <nandana....@gmail.com>
Subject Re: Rampart error (Incoming message does not contain required Security header)
Date Thu, 16 Jul 2009 03:57:45 GMT
Hi Chinmoy,
        As it seems, you don't have the "OutflowSecurity" parameter defined
in the client side. So basically you need to have a client side axis2 with
that parameter and then create a ConfigurationContext out of it. Rampart
basic sample 01 shows how to do this [1],[2]. But you won't be able to pass
username/password through options when you use parameter based
configuration. Is there a possibility for you to use policy based
configuration. If so, please look at following tutorial [2].

regards,
Nandana

[1] -
https://svn.apache.org/repos/asf/webservices/rampart/trunk/java/modules/rampart-samples/basic/sample01/client.axis2.xml
[2] -
https://svn.apache.org/repos/asf/webservices/rampart/trunk/java/modules/rampart-samples/basic/sample01/src/org/apache/rampart/samples/sample01/Client.java
[3] - https://www.wso2.org/library/3190

On Wed, Jul 15, 2009 at 5:45 PM, Chinmoy Chakraborty <cchinu@gmail.com>wrote:

> Hi,
>
> I am getting following error while trying to invoke a WS-Security enabled
> client request:
>
> org.apache.axis2.AxisFault: WSDoAllReceiver: Incoming message does not
> contain required Security header
>  at
> org.apache.rampart.handler.WSDoAllReceiver.processBasic(WSDoAllReceiver.java:221)
>  at
> org.apache.rampart.handler.WSDoAllReceiver.processMessage(WSDoAllReceiver.java:86)
>  at
> org.apache.rampart.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:72)
>  at org.apache.axis2.engine.Phase.invoke(Phase.java:317)
>  at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
>  at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
>
> I am missing something I know but not sure what. Following is my client
> code:
>
>       ServiceClient client = new ServiceClient();
>       Options options = new Options();
>       options.setAction("invoke");
>       options.setUserName("system");
>       options.setPassword("manager");
>       options.setTo(new EndpointReference(wsServerUrl + "services/ABS"));
>       client.setOptions(options);
>       client.engageModule("rampart");
>       OMElement response = client.sendReceive(getPayload(args));
>
> Following is my services.xml:
>
> <service name="ABS" targetNamespace="http://www.abc.com/webservice">
> <description>Service description for ABS</description>
> <schema schemaNamespace="http://www.abc.com/webservice"/<http://www.abc.com/webservice%22/>
> >
> <parameter name="ServiceClass">ABS</parameter>
> <parameter name = "disasbleREST">true</parameter>
> <operation name="invoke">
> <messageReceiver
> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> </operation>
> <module ref="soapmonitor"/>
> <module ref="rampart" />
> <parameter name = "InflowSecurity"><action>
> <items>UsernameToken</items>
> <passwordCallbackClass>web.ws.control.PWCBHandler</passwordCallbackClass>
> </action>
> </parameter>
> <parameter name="OutflowSecurity">
>  <action>
>   <items>UsernameToken</items>
>   <passwordCallbackClass>web.ws.control.PWCBHandler</passwordCallbackClass>
>  </action>
> </parameter>
> </service>
>
> Any idea?
>
> Chinmoy
>



-- 
Nandana Mihindukulasooriya
WSO2 inc.

http://nandana83.blogspot.com/
http://www.wso2.org

Mime
View raw message