Hi,

I finally founded this

        try {
            JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
            factory.setServiceClass(PensionWebService.class);
            factory.setAddress("
http://localhost:8080/xxxx/services/pensionWeb?wsdl";);
            factory.setUsername("xxx");
            factory.setPassword("yyyy");
            PensionWebService client = (PensionWebService) factory.create();

Thanks for your reply

Best regards

Alexandre

2009/12/9 Eamonn Dwyer <[email protected]>

>
>
> Hi Alexandre
>
> does this work for you? ...
>
>      HTTPConduit httpConduit = (HTTPConduit)
> ClientProxy.getClient(port).getConduit();
>      AuthorizationPolicy ap = new AuthorizationPolicy();
>      ap.setUserName("Myname");
>      ap.setPassword("Mypassword");
>      httpConduit.setAuthorization(ap);
>
> Regards
> Eamonn
>
> > Date: Wed, 9 Dec 2009 06:57:20 +0100
> > Subject: username and password of webservices
> > From: [email protected]
> > To: [email protected]
> >
> > Hi,
> >
> > We actually store the username and the password for calling external
> > webservice and then use it like this way on our cxf config file
> >
> >     <jaxws:client id="ZWsCustomerCreate"
> >         serviceClass="xxx.customer.create.ZWsCustomerCreate"
> >
> >         address="${webservice.sap.Z_WS_CUSTOMER_CREATE.url}">
> >         <jaxws:inInterceptors>
> >             <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"
> />
> >         </jaxws:inInterceptors>
> >         <jaxws:outInterceptors>
> >             <bean
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"
> > />
> >         </jaxws:outInterceptors>
> >     </jaxws:client>
> >
> >     <http:conduit name="*Z_WS_ACC_DOCUMENT_POSTPort.http-conduit">
> >         <http:authorization>
> >
> >
> <sec:UserName>${webservice.sap.Z_WS_ACC_DOCUMENT_POST.username}</sec:UserName>
> >
> >
> <sec:Password>${webservice.sap.Z_WS_ACC_DOCUMENT_POST.password}</sec:Password>
> >         </http:authorization>
> > .........
> >
> > Is there any way to remove the variable from the config file or encrypt
> it
> > in a Java class ?
> >
> > ${webservice.sap.Z_WS_ACC_DOCUMENT_POST.username}
> >
> > Thanks in advance.
>
> _________________________________________________________________
> New Windows 7: Simplify what you do everyday. Find the right PC for you.
> http://windows.microsoft.com/shop

Reply via email to