You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Nishant Joshi <ni...@gmail.com> on 2011/01/15 14:53:37 UTC

Tuscany client (SCA client) with HTTP Basic Authentication.

Hi All,

I am not sure if we can do HTTP basic authentication with SCA client, like
below...
stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "username");
stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "password");

I have tried to cast service object to Stub but couldnt successful to do
it.
Please let me know if anybody has idea on it. I have also gone thorough with
the policy sample, but i want just simple basic HTTP authentication and want
to pass username/passowrd in header of HTTP message. Service is already
running under HTTP basic authenitcation and JAX-RPC client (using generated
classes/ proxy from WSDL) is working fine with it by passing above
properties.

Please let me know if you required more input for my question.

Thanks,
Nishant

Re: Tuscany client (SCA client) with HTTP Basic Authentication.

Posted by Simon Nash <na...@apache.org>.
Nishant Joshi wrote:
> Hi All,
>  
> I am not sure if we can do HTTP basic authentication with SCA client, 
> like below...
> stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "username");
> stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "password");
>  
> I have tried to cast service object to Stub but couldnt successful to do 
> it. 
> Please let me know if anybody has idea on it. I have also gone thorough 
> with the policy sample, but i want just simple basic HTTP authentication 
> and want to pass username/passowrd in header of HTTP message. Service is 
> already running under HTTP basic authenitcation and JAX-RPC client 
> (using generated classes/ proxy from WSDL) is working fine with it by 
> passing above properties.
>  
> Please let me know if you required more input for my question.
>  
> Thanks,
> Nishant
 >
Hi Nishant,
Tuscany doesn't provide any stub methods for doing this.  The reason
is that this would cause infrastructure code to be mixed with
business logic.  SCA is designed around the principle of separating
infrastructure concerns from business logic, so that the same business
logic can be used with different infrastructure technologies.

The policy framework makes it easy to do what you need by adding intents
and policy sets to your component definitions and definitions.xml file.

   Simon