Just one thing,
although
conduit.getAuthorization().setUserName(username);
works, I would like to follow the pattern of
AuthorizationPolicy policy conduit.getProxyAuthorization();
policy.setUserName(username);
to modify an existing policy (you may want to clone it for safety)
or just do a brand new one.
AuthorizationPolicy policy = new AuthorizationPolicy();
policy.setUserName(username)
then do a
conduit.setProxyAuthorizationPolicy();
The reason is that, doing the "set" (theoretically) triggers any dynamic
changes to the conduit configuration should something depend on it.
See the implementation on HTTPConduit.setSslClient for an example.
Cheers,
-Polar
Changing things in the policy on the backend just *happens* to work
right now.
tog wrote:
Polar
Thanks very much, my problem is solved. I will then provide a small
patch to
URIResolver so that proxies are fully supported.
Cheers
Guillaume
On 4/30/07, Polar Humenn <[EMAIL PROTECTED]> wrote:
Hi,
Code correct below:
tog wrote:
> I have this in my code, isn't it the same ?
>
> if (host != null) {
> conduit.getClient().setProxyServer(host);
> if (port != null) {
>
> conduit.getClient().setProxyServerPort(Integer.parseInt
> (port));
> }
> if ((username != null) && (password != null)) {
> conduit.getAuthorization().setUserName(username);
> conduit.getAuthorization().setPassword(password);
> }
Change the above to:
conduit.getProxyAuthorization().setUserName(username);
conduit.getProxyAuthorization().setPassword(password);
> }
>
> If yes this put an "Authorization" in my http header while my proxy is
> expecting "Proxy-Authorization"
>
> Is there a link where to find this information ?
>
>
>
> On 4/30/07, Polar Humenn <[EMAIL PROTECTED]> wrote:
>>
>> You have to set the "ProxyAuthorization" property
>>
>> <http:conduit>
>> <proxyAuthorization ....>
>> </http:conduit>
>>
>> or
>>
>> AuthorizationPolicy policy = httpConduit.getProxyAuthorization();
>> policy.set....
>> httpConduit.setProxyAuthorization(policy);
>>
>> Cheers,
>> -Polar
>>
>> tog wrote:
>> > Hi Polar,
>> >
>> > Thanks for the answer, it's better. Now I have the problem that the
>> > request
>> > looks like this:
>> >
>> > POST http://www.webservicex.net/CurrencyConvertor.asmx HTTP/1.1
>> > Content-Type: text/xml
>> > Authorization: Basic c3UxNjc2NjpraXJhdmk5OA==
>> > SOAPAction: "http://www.webserviceX.NET/ConversionRate"
>> > Cache-Control: no-cache
>> > Pragma: no-cache
>> > User-Agent: Java/1.5.0_11
>> > Host: www.webservicex.net
>> > Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
>> > Proxy-Connection: keep-alive
>> > Content-Length: 476
>> >
>> > <soap:Envelope
>> > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
>> "><soap:Body><ConversionRate
>> >
>> > xmlns="http://www.webserviceX.NET/"><FromCurrency xmlns:xs="
>> > http://www.w3.org/2001/XMLSchema" xmlns:xsi="
>> > http://www.w3.org/2001/XMLSchema-instance"
>> > xsi:type="xs:string">USD</FromCurrency><ToCurrency xmlns:xs="
>> > http://www.w3.org/2001/XMLSchema" xmlns:xsi="
>> > http://www.w3.org/2001/XMLSchema-instance"
>> >
>>
xsi:type="xs:string">EUR</ToCurrency></ConversionRate></soap:Body></soap:Envelope
>>
>> >
>> >
>> > The problem is that I am expecting
>> >
>> > Proxy-Authorization: Basic c3UxNjc2NjpraXJhdmk5OA==
>> >
>> > rather than
>> >
>> > Authorization: Basic c3UxNjc2NjpraXJhdmk5OA==
>> >
>> > Is that a bug or am I doing something wrong ?
>> >
>> > Cheers
>> > Guillaume
>> >
>> > On 4/30/07, Polar Humenn <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Hi Guzillaume,
>> >>
>> >> Yes, you can turn "chunking" off on the client side.
>> >> You can "config" it the "Springway"
>> >>
>> >> <http:conduit id="{.....}PortName">
>> >> <client AllowChunking="false">
>> >> </http:conduit>
>> >>
>> >> Or you can do it programatically by
>> >>
>> >> SomePort port = service.getPort(...);
>> >>
>> >> Client client =
>> >> ClientProxy.getClient(port);
>> >> HttpConduit httpConduit = (HTTPConduit)
>> >> client.getConduit();
>> >> HTTPClientPolicy httpClientPolicy = httpConduit.getClient();
>> >>
>> >> httpClientPolicy.setAllowChunking(false);
>> >>
>> >> httpConduit.setClient(httpClientPolicy);
>> >>
>> >> Cheers,
>> >> -Polar
>> >>
>> >> tog wrote:
>> >> > Hi,
>> >> >
>> >> > I am preparing a patch for being able to use cxf with proxies. I
>> was
>> >> > stuck
>> >> > till recently by a weird problem after playing and forging the
POST
>> >> > request
>> >> > that cxf is using, I found that my proxy was not supporting
>> >> chunking. Is
>> >> > there a way to turn this feature off ?
>> >> >
>> >> > Cheers
>> >> > Guillaume
>> >> >
>> >>
>> >>
>> >
>>
>>
>