You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Hussain, Asim" <AH...@carlsoncanada.com> on 2006/08/30 23:10:09 UTC

RE: Urgent help - want to add WS security UserNameToken to a head er of existing stub client webservice

Hi, I have looked into that.  What I need is simply to add headers to
existing stubs.  Hopefully that will be it.  Can that be done?

 

-----Original Message-----
From: Shi, Jeffrey [mailto:Jeffrey.Shi@ddytech.com] 
Sent: Wednesday, August 30, 2006 5:01 PM
To: axis-user@ws.apache.org
Subject: RE: Urgent help - want to add WS security UserNameToken to a header
of existing stub client webservice

 

Hi, Hussain

 

I think you may need to use WSS4J, but I am just reading the document of
wss4J. I am working a pilot project which a java client consuming a .NET WSE
enabled web service.

 

Hopefully it can help you a little bit.

 

Jeffrey

 

  _____  

From: Hussain, Asim [mailto:AHussain@carlsoncanada.com] 
Sent: Wednesday, August 30, 2006 2:23 PM
To: 'axis-user@ws.apache.org'
Subject: Urgent help - want to add WS security UserNameToken to a header of
existing stub client webservice 

 

Hi people, I am a newbie to Axis and I am lost :-)

Here is the scenario:

 

Based on a WSDL file, I generated stub classes using axis for a web service
that is using .Net.  

The web service provider has now added WSE.  Can I still use the stub
classes but physically go into it and just add a header??  I know I need to
add a header because if I run the service without augmenting anything, I
get: 

 

AxisFault

 faultCode:
{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1
.0.xsd}Security

 faultSubcode: 

 faultString: Microsoft.Web.Services3.Security.SecurityFault: Security
requirements are not satisfied because the security header is not present in
the incoming message.

 

I believe I need to 

1)       Create a header

2)       Add a wsse:Security node to it

 

I have spent the whole day trying to work an example using a security
header, but then I need to figure out a way to add a custom bean to the
request and get a response.  The custom bean has parameters in it that the
web service consumes and then gives an appropriate reponse.

 

I think I can work with the stub classes, and just insert header info...but
I am not sure if this is the cleanest way.  I did notice that there is a
call made:

setRequestHeaders(_call); that was generate by the WSDL2Java process...but
these headers naturally do not contain the security stuff...

 

 

Any help would be greatly appreciated...I am stuck in the mud!!!!!