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 Ted Jones <Tj...@metamatrix.com> on 2007/03/27 22:03:55 UTC

Axis2 Client Stub not Generating WS-Security Headers

I have an Axis2 1.1.1 ADB generated client stub that is instantiated
using a client axis2.xml config and pointing to a client repository that
has the rampart and addressing mar files. The config file and repository
location are loaded via URL. In debug, I can see the rampart and
addressing modules are engaged. In my client code, I have added the
following properties to the serviceclient's options instance:
 
 options.setProperty(WSConstants.WSSE_NS ,
WSConstants.USERNAME_TOKEN_LN);
 
options.setProperty(WSConstants.USERNAME_LN,getConnectionProperties().ge
tUserid());
 
options.setProperty(WSConstants.PASSWORD_LN,getConnectionProperties().ge
tPassword());
 options.setProperty(WSConstants.PASSWORD_TYPE_ATTR,
WSConstants.PASSWORD_TEXT);
 
The WS-Security headers are never inserted into the soap request and I
receive the ever-popular "org.apache.axis2.AxisFault: WSDoAllReceiver:
Incoming message does not contain required Security header".
 
This web service and the ws-security logic works using soapUI (a great
*free* tool by the way).
 
Is there some other property I need to set in the options or something
else I need to be doing?
 
Thanks
Ted
 
 

RE: Axis2 Client Stub not Generating WS-Security Headers

Posted by Ted Jones <Tj...@metamatrix.com>.
Thanks for your assistance Ruchith. I was able to get it working.

Thanks,
Ted

-----Original Message-----
From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com] 
Sent: Thursday, March 29, 2007 2:34 AM
To: axis-user@ws.apache.org
Subject: Re: Axis2 Client Stub not Generating WS-Security Headers

Hi Ted,

On 3/28/07, Ted Jones <Tj...@metamatrix.com> wrote:
> Thank you for the reply Ruchith. I am following these instructions 
> with the exception of the service invocation since I am using my 
> generated client stub. Does the client repository location need to be 
> included in order to generate the proper stub logic for inserting the 
> WS-Security headers?

When you codegen the stub will *not* contain any logic related to
rampart.

> Also, the code sample links are broken on the link you gave me.

The link is now fixed.

Thanks,
Ruchith

>
> Thanks,
> Ted
>
> -----Original Message-----
> From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com]
> Sent: Tuesday, March 27, 2007 11:04 PM
> To: axis-user@ws.apache.org
> Subject: Re: Axis2 Client Stub not Generating WS-Security Headers
>
> Hi Ted,
>
> Please see this :
> http://www.wso2.org/library/240
>
> Thanks,
> Ruchith
>
> On 3/28/07, Ted Jones <Tj...@metamatrix.com> wrote:
> >
> >
> > I have an Axis2 1.1.1 ADB generated client stub that is instantiated

> > using a client axis2.xml config and pointing to a client repository 
> > that has the rampart and addressing mar files. The config file and 
> > repository location are loaded via URL. In debug, I can see the 
> > rampart and addressing modules are engaged. In my client code, I 
> > have added the following properties to the serviceclient's options
> instance:
> >
> >  options.setProperty(WSConstants.WSSE_NS , 
> > WSConstants.USERNAME_TOKEN_LN); 
> >
options.setProperty(WSConstants.USERNAME_LN,getConnectionProperties().
> > getUserid());
> >
options.setProperty(WSConstants.PASSWORD_LN,getConnectionProperties().
> > getPassword());  options.setProperty(WSConstants.PASSWORD_TYPE_ATTR,
> > WSConstants.PASSWORD_TEXT);
> >
> > The WS-Security headers are never inserted into the soap request and

> > I
>
> > receive the ever-popular "org.apache.axis2.AxisFault:
WSDoAllReceiver:
> > Incoming message does not contain required Security header".
> >
> > This web service and the ws-security logic works using soapUI (a 
> > great
> > *free* tool by the way).
> >
> > Is there some other property I need to set in the options or 
> > something
>
> > else I need to be doing?
> >
> > Thanks
> > Ted
> >
> >
>
>
> --
> www.ruchith.org
> www.wso2.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


--
www.ruchith.org
www.wso2.org

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 Client Stub not Generating WS-Security Headers

Posted by Ruchith Fernando <ru...@gmail.com>.
Hi Ted,

On 3/28/07, Ted Jones <Tj...@metamatrix.com> wrote:
> Thank you for the reply Ruchith. I am following these instructions with
> the exception of the service invocation since I am using my generated
> client stub. Does the client repository location need to be included in
> order to generate the proper stub logic for inserting the WS-Security
> headers?

When you codegen the stub will *not* contain any logic related to rampart.

> Also, the code sample links are broken on the link you gave me.

The link is now fixed.

Thanks,
Ruchith

>
> Thanks,
> Ted
>
> -----Original Message-----
> From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com]
> Sent: Tuesday, March 27, 2007 11:04 PM
> To: axis-user@ws.apache.org
> Subject: Re: Axis2 Client Stub not Generating WS-Security Headers
>
> Hi Ted,
>
> Please see this :
> http://www.wso2.org/library/240
>
> Thanks,
> Ruchith
>
> On 3/28/07, Ted Jones <Tj...@metamatrix.com> wrote:
> >
> >
> > I have an Axis2 1.1.1 ADB generated client stub that is instantiated
> > using a client axis2.xml config and pointing to a client repository
> > that has the rampart and addressing mar files. The config file and
> > repository location are loaded via URL. In debug, I can see the
> > rampart and addressing modules are engaged. In my client code, I have
> > added the following properties to the serviceclient's options
> instance:
> >
> >  options.setProperty(WSConstants.WSSE_NS ,
> > WSConstants.USERNAME_TOKEN_LN);
> > options.setProperty(WSConstants.USERNAME_LN,getConnectionProperties().
> > getUserid());
> > options.setProperty(WSConstants.PASSWORD_LN,getConnectionProperties().
> > getPassword());  options.setProperty(WSConstants.PASSWORD_TYPE_ATTR,
> > WSConstants.PASSWORD_TEXT);
> >
> > The WS-Security headers are never inserted into the soap request and I
>
> > receive the ever-popular "org.apache.axis2.AxisFault: WSDoAllReceiver:
> > Incoming message does not contain required Security header".
> >
> > This web service and the ws-security logic works using soapUI (a great
> > *free* tool by the way).
> >
> > Is there some other property I need to set in the options or something
>
> > else I need to be doing?
> >
> > Thanks
> > Ted
> >
> >
>
>
> --
> www.ruchith.org
> www.wso2.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
www.ruchith.org
www.wso2.org

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Axis2 Client Stub not Generating WS-Security Headers

Posted by Ted Jones <Tj...@metamatrix.com>.
Thank you for the reply Ruchith. I am following these instructions with
the exception of the service invocation since I am using my generated
client stub. Does the client repository location need to be included in
order to generate the proper stub logic for inserting the WS-Security
headers? Also, the code sample links are broken on the link you gave me.

Thanks,
Ted

-----Original Message-----
From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com] 
Sent: Tuesday, March 27, 2007 11:04 PM
To: axis-user@ws.apache.org
Subject: Re: Axis2 Client Stub not Generating WS-Security Headers

Hi Ted,

Please see this :
http://www.wso2.org/library/240

Thanks,
Ruchith

On 3/28/07, Ted Jones <Tj...@metamatrix.com> wrote:
>
>
> I have an Axis2 1.1.1 ADB generated client stub that is instantiated 
> using a client axis2.xml config and pointing to a client repository 
> that has the rampart and addressing mar files. The config file and 
> repository location are loaded via URL. In debug, I can see the 
> rampart and addressing modules are engaged. In my client code, I have 
> added the following properties to the serviceclient's options
instance:
>
>  options.setProperty(WSConstants.WSSE_NS , 
> WSConstants.USERNAME_TOKEN_LN); 
> options.setProperty(WSConstants.USERNAME_LN,getConnectionProperties().
> getUserid()); 
> options.setProperty(WSConstants.PASSWORD_LN,getConnectionProperties().
> getPassword());  options.setProperty(WSConstants.PASSWORD_TYPE_ATTR,
> WSConstants.PASSWORD_TEXT);
>
> The WS-Security headers are never inserted into the soap request and I

> receive the ever-popular "org.apache.axis2.AxisFault: WSDoAllReceiver:
> Incoming message does not contain required Security header".
>
> This web service and the ws-security logic works using soapUI (a great
> *free* tool by the way).
>
> Is there some other property I need to set in the options or something

> else I need to be doing?
>
> Thanks
> Ted
>
>


--
www.ruchith.org
www.wso2.org

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 Client Stub not Generating WS-Security Headers

Posted by Ruchith Fernando <ru...@gmail.com>.
Hi Ted,

Please see this :
http://www.wso2.org/library/240

Thanks,
Ruchith

On 3/28/07, Ted Jones <Tj...@metamatrix.com> wrote:
>
>
> I have an Axis2 1.1.1 ADB generated client stub that is instantiated using a
> client axis2.xml config and pointing to a client repository that has the
> rampart and addressing mar files. The config file and repository location
> are loaded via URL. In debug, I can see the rampart and addressing modules
> are engaged. In my client code, I have added the following properties to the
> serviceclient's options instance:
>
>  options.setProperty(WSConstants.WSSE_NS , WSConstants.USERNAME_TOKEN_LN);
> options.setProperty(WSConstants.USERNAME_LN,getConnectionProperties().getUserid());
> options.setProperty(WSConstants.PASSWORD_LN,getConnectionProperties().getPassword());
>  options.setProperty(WSConstants.PASSWORD_TYPE_ATTR,
> WSConstants.PASSWORD_TEXT);
>
> The WS-Security headers are never inserted into the soap request and I
> receive the ever-popular "org.apache.axis2.AxisFault: WSDoAllReceiver:
> Incoming message does not contain required Security header".
>
> This web service and the ws-security logic works using soapUI (a great
> *free* tool by the way).
>
> Is there some other property I need to set in the options or something else
> I need to be doing?
>
> Thanks
> Ted
>
>


-- 
www.ruchith.org
www.wso2.org

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Axis2 Client Stub not Generating WS-Security Headers

Posted by Ted Jones <Tj...@metamatrix.com>.
I'm thinking this is due to not using the -r in my WSDL2JAVA command to
include my client repository? I added this and now I am getting the
following:
 
java.lang.IllegalStateException: No valid ObjectCreator found.
 
Threads I have come across indicate that this error is caused by an
incorrect version of the STAX jar, but it is the one that came with
Axis2 1.1.1. My classpath does not include any jars that are not part of
the Axis2 1.1.1 distribution.
 
Any ideas?
 
Thanks,
Ted

________________________________

From: Ted Jones [mailto:Tjones@metamatrix.com] 
Sent: Tuesday, March 27, 2007 3:04 PM
To: axis-user@ws.apache.org
Subject: Axis2 Client Stub not Generating WS-Security Headers


I have an Axis2 1.1.1 ADB generated client stub that is instantiated
using a client axis2.xml config and pointing to a client repository that
has the rampart and addressing mar files. The config file and repository
location are loaded via URL. In debug, I can see the rampart and
addressing modules are engaged. In my client code, I have added the
following properties to the serviceclient's options instance:
 
 options.setProperty(WSConstants.WSSE_NS ,
WSConstants.USERNAME_TOKEN_LN);
 
options.setProperty(WSConstants.USERNAME_LN,getConnectionProperties().ge
tUserid());
 
options.setProperty(WSConstants.PASSWORD_LN,getConnectionProperties().ge
tPassword());
 options.setProperty(WSConstants.PASSWORD_TYPE_ATTR,
WSConstants.PASSWORD_TEXT);
 
The WS-Security headers are never inserted into the soap request and I
receive the ever-popular "org.apache.axis2.AxisFault: WSDoAllReceiver:
Incoming message does not contain required Security header".
 
This web service and the ws-security logic works using soapUI (a great
*free* tool by the way).
 
Is there some other property I need to set in the options or something
else I need to be doing?
 
Thanks
Ted