Hi,

Once you generated the stub, you need to do the followings

1) Creating a stub instance providing a ConfigurationContext. The 
ConfigurationContext should point to a axis2 repository where it contains the 
Rampart module. It is necessary since Rampart module is responsible for 
interpreting any WS-Security policies.

e.g.
ConfigurationContext config = 
ConfigurationContextFactory.createConfigurationContextFromFileSystem("path-to-repository");
SampleStub stub = new SampleStub(config);

2) Set Username and Password

e.g.
ServiceClient serviceClient = stub._getServiceClient(co);
        
Options options = serviceClient.getOptions();
options.setUserName("username");
options.setPassword("password");

Now you should be able to use that stub instance to communicate with that particular Web service without any further configuration.
HTH,
Sanka




[EMAIL PROTECTED] wrote:
Hi there,

Does Axis 2 version1.3 support WS-policy? If it does, does anybody have
sample codes for the Client support of how to use WS-policy?
Our current situation is we have WS service (WSDL) provided with WS-policy.
We are interested to use Axis2 for the client to talk to the WS but we are
not sure how to get through the WS-policy. So if anybody knows s=some
sample code (could be as sample of to set User name/passcode) would be
great!

Thanks in advance!

Feng


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Sanka Samaranayake
WSO2 Inc.

http://www.bloglines.com/blog/sanka
http://www.wso2.org/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to