Feng You should just need to call
stub._getServiceClient().getOptions().setUsername("foo"); stub._getServiceClient().getOptions().setPassword("bar"); Paul On 10/31/07, Feng Lu <[EMAIL PROTECTED]> wrote: > > > > I have sent you an email yesterday asking whether AXIS2 support WS-policy > or not, because I saw some of the thread in the user group with the similar > topics. If you could send me any suggestion or information, that would > really appreciated! > > Here is our situation: we have a WS service WSDL (attched bellow) with > WS-policy, hosted by Weblogic server. I used Axis2 on client side (with > Rapart extension) to generate the stub and I am able to see the setPolicy is > called in the stub source code. However, I am not sure what I should do to > write some client code with Axis2 to support the policy. Our WSDL policy is > very simple, just with user name and password: > > <wsp:Policy s0:Id="Auth.xml"> > - <wssp:Identity xmlns:wssp="http://www.bea.com/wls90/security/policy"> > - <wssp:SupportedTokens> > - <wssp:SecurityToken TokenType=" > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken > "> > <wssp:UsePassword Type=" > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" > /> > </wssp:SecurityToken> > </wssp:SupportedTokens> > </wssp:Identity> > </wsp:Policy> > > Any help would be greatly appreciated. > > Thanks > > Frank. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > -- Paul Fremantle Co-Founder and VP of Technical Sales, WSO2 OASIS WS-RX TC Co-chair blog: http://pzf.fremantle.org [EMAIL PROTECTED] "Oxygenating the Web Service Platform", www.wso2.com