You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by tog <gu...@gmail.com> on 2007/04/30 13:56:59 UTC

Proxy settings

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

Re: Proxy settings

Posted by tog <gu...@gmail.com>.
Ok, that's fine with me.
Btw, are all these features documented somewhere ? is there as well a good
book covering the WS-* features (-Policy, Security, ...)

Cheers
Guillaume

On 4/30/07, Daniel Kulp <dk...@apache.org> wrote:
>
> Guillaume,
>
> On Monday 30 April 2007 10:49, 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);
> >                 }
> >             }
> >
> > If yes this put an "Authorization" in my http header while my proxy is
> > expecting "Proxy-Authorization"
>
>
> This is configuring the basic auth for the service itself, not the proxy.
> Those can (and usually are) very different authorization policies.   The
> getProxyAuthorization() call is what you need.
>
> Thanks!
> Dan
>
>
>
>
> >
> > Is there a link where to find this information ?
> >
> > On 4/30/07, Polar Humenn <ph...@iona.com> 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 <ph...@iona.com> 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
>
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog
>

Re: Proxy settings

Posted by Daniel Kulp <dk...@apache.org>.
Guillaume,

On Monday 30 April 2007 10:49, 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);
>                 }
>             }
>
> If yes this put an "Authorization" in my http header while my proxy is
> expecting "Proxy-Authorization"

 
This is configuring the basic auth for the service itself, not the proxy.   
Those can (and usually are) very different authorization policies.   The 
getProxyAuthorization() call is what you need.

Thanks!
Dan




>
> Is there a link where to find this information ?
>
> On 4/30/07, Polar Humenn <ph...@iona.com> 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 <ph...@iona.com> 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

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: Proxy settings

Posted by Polar Humenn <ph...@iona.com>.
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 <ph...@iona.com> 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 <ph...@iona.com> 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 <ph...@iona.com> 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
>> >> >> >
>> >> >>
>> >> >>
>> >> >
>> >>
>> >>
>> >
>>
>>
>


Re: Proxy settings

Posted by tog <gu...@gmail.com>.
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 <ph...@iona.com> 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 <ph...@iona.com> 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 <ph...@iona.com> 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
> >> >> >
> >> >>
> >> >>
> >> >
> >>
> >>
> >
>
>

Re: Proxy settings

Posted by Polar Humenn <ph...@iona.com>.
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 <ph...@iona.com> 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 <ph...@iona.com> 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
>> >> >
>> >>
>> >>
>> >
>>
>>
>


Re: Proxy settings

Posted by tog <gu...@gmail.com>.
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);
                }
            }

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 <ph...@iona.com> 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 <ph...@iona.com> 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
> >> >
> >>
> >>
> >
>
>

Re: Proxy settings

Posted by Polar Humenn <ph...@iona.com>.
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 <ph...@iona.com> 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
>> >
>>
>>
>


Re: Proxy settings

Posted by tog <gu...@gmail.com>.
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 <ph...@iona.com> 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
> >
>
>

Re: Proxy settings

Posted by Polar Humenn <ph...@iona.com>.
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
>