You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by junker66 <gm...@yahoo.com> on 2008/03/10 16:32:41 UTC

Re: HTTP Basic Auth with wsdl2java generated Client


Will this be addressed in a 2.0.5 or 2.1?

g


Willem2 wrote:
> 
> Hi Petrica
> 
> Here is the configuration guide of the HTTP Client [1] 
> http://cwiki.apache.org/CXF20DOC/client-http-transport.html
> Your can set the proxy server , and proxy server port , 
> proxyAuthorization etc
> 
> But current CXF not support to get the wsdl with the http proxy or basic 
> authentication setting,
> because we don't use the http conduit to get the wsdl.
> 
> Willem.
> 
> petrica wrote:
>> Hello to all,
>>
>> I have a similar problem with a generated client ( it's included in mtom
>> samples from Apache CXF 2.0 distribution) when I am behind of the
>> corporate
>> firewall. I can't pass the proxy server and I have the error : "Server
>> returned HTTP response code: 407 for URL ... "
>>
>>         TestMtomService tms = new TestMtomService(wsdlURL, SERVICE_NAME);
>>         TestMtom port = (TestMtom) tms.getPort(PORT_NAME,
>> TestMtom.class);
>>         Binding binding = ((BindingProvider)port).getBinding();
>>         ((SOAPBinding)binding).setMTOMEnabled(true);
>>
>>         Client clt = ClientProxy.getClient(port);
>>
>> and I tried many posibilities included the code like Alex.
>>
>> More , a created a cxf.xml file that is loaded (it seems) by method call
>> <<
>> new TestMtomService(wsdlURL, SERVICE_NAME) >>. I let these settings in it
>> :
>>
>>   
>>
>>     
>>     	
>> 	
>> 	
>>
>>   
>>
>> Also I created a class named ClientAuthent which extends
>> HttpBasicAuthSupplier and override getPreemptiveUserPass 
>>     public UserPass getPreemptiveUserPass(
>>             String  conduitName,
>>             URL     currentURL,
>>             Message message) 
>>     {
>>     	return  createUserPass( "myuser" ,"mypassword");
>>     } 
>>
>>
>> I don't know what other settings have to do for reading all informations
>> for
>> ProxyServer, ProxyPort, ProxyUser and ProxyPassword.
>> Also, I didn't find out others attributes for  and .
>>
>> Maybe this will solve the problem.
>>
>> Can somebody help me ?
>>
>> Thank in advance for help,
>> Petrica
>> ==================================================================
>>
>> Willem Jiang-2 wrote:
>>   
>>> Hi Axel,
>>>
>>> I checked the HTTPConduit code, your way to set the http basic 
>>> authentication is right.
>>>
>>> Can you use tcpmon to check the authentication informantion has been set 
>>> into the http headers?
>>>
>>> If not, I think it must be the CXF's bug.
>>>
>>>
>>> Willem.
>>>
>>> Axel Becker wrote:
>>>     
>>>> Hi,
>>>>
>>>> i generated the client code with the wsdl2java from an existing wsdl.
>>>>
>>>> now i want to connect to this service (it is an axis 1 webservice). the
>>>> service ist protected with a http basic authentication. i use the
>>>> following
>>>> code, but it doesnt work :-(
>>>>
>>>> INFOServiceService ss = new INFOServiceService(SERVICE_URL,
>>>> SERVICE_NAME);
>>>>
>>>> Client client = ClientProxy.getClient(ss.getINFOService());
>>>> HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
>>>> 			
>>>> httpConduit.getAuthorization().setUserName("username1");
>>>> httpConduit.getProxyAuthorization().setUserName("username1");
>>>> 			
>>>> INFOService service = ss.getINFOService();
>>>> //do somthing with service
>>>>
>>>> Where is the mistake?
>>>>
>>>> Thanks for your help!
>>>> Axel
>>>>
>>>>
>>>> PS: the serverside (axis1) code to get the auth parameter is:
>>>> String username = MessageContext.getCurrentContext().getUsername();
>>>>
>>>>
>>>>   
>>>>       
>>>     
>>
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/HTTP-Basic-Auth-with-wsdl2java-generated-Client-tp11800307p15950821.html
Sent from the cxf-user mailing list archive at Nabble.com.