Re: Accessing WebService that requires username/password

2008-03-07 Thread Ian Roberts
xbranko wrote: For me the problem is that I do not have access to the server, i.e. I have to do everything from the client side. Also javax.xml.ws.Service class does not have a default constructor, but rather only protected constructor that takes java.net.URL wsdlDocumentLocation and QName

Re: Accessing WebService that requires username/password

2008-03-07 Thread Daniel Kulp
Unfortunately, this is a known issue. :-( Basically, for the SOAP communication, the http:conduit bean things in the config are used to pick up authentication things, ssl certs, etc... so a proper secure connection can be made to protect the data. Unfortunately, the WSDL retrieval part

Re: Accessing WebService that requires username/password

2008-03-07 Thread xbranko
ianroberts wrote: If it's internally using the standard URL mechanism then have you tried registering a java.net.Authenticator to supply the username and password? http://www.javaworld.com/javaworld/javatips/jw-javatip46.html Ian That did it! This is good in simple case of

Re: Accessing WebService that requires username/password

2008-03-06 Thread xbranko
I tried the workaround as you suggested. Here is what I have in my bean: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:sec=http://cxf.apache.org/configuration/security;

Re: Accessing WebService that requires username/password

2008-03-06 Thread xbranko
Yes it does. I was able to use it, by using a locally cached copy (to avoid the authentication problem). Given that the auto generated code uses class javax.xml.ws.Service, during object instantiation the problem is there (see my answers to previous posts). It seems that for authenticated web

Re: Accessing WebService that requires username/password

2008-03-05 Thread Glen Mazza
Sadly, I was able to get this portion of your code below to work for Metro but not CXF: rc.put(BindingProvider.USERNAME_PROPERTY, userName); rc.put(BindingProvider.PASSWORD_PROPERTY, password); I have been meaning to look at this to find out the reason why. But in the meantime,

Re: Accessing WebService that requires username/password

2008-03-05 Thread Willem Jiang
Does the WSDL_LOCATION also point to the server which you need to access? If so , here is my explain of this issue. In CXF we just use WSDL4J and use a common URL class to load the wsdl, so what you set on the client side will not affect the WSDL4J's URL. CXF will build a service model with the

RE: Accessing WebService that requires username/password

2008-03-05 Thread Daniel Lipofsky
I am using something like this: FoobarService foobarService = new FoobarService(); FoobarPortType foobarPort = foobarService.getFoobarPort(); context = ((BindingProvider) foobarPort).getRequestContext(); context.put(USERNAME, me); context.put(PASSWORD, hello);