You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by zul <mu...@hotmail.com> on 2006/09/14 09:45:10 UTC

Http-Binding Example Running Behind a HTTP Proxy server

Hi,

It seems that running the http-binding example behind a http proxy server
have a connection time-out problem. Where do I set the http proxy properties
(such as proxyhost, proxyport, user, password) for connecting to the
external server ("http://64.124.140.30:9090/soap") and what is the
properties name or is it set (have to hardcode) at the sending server
program file ?

Thankx.

Regards,
   Zul
-- 
View this message in context: http://www.nabble.com/Http-Binding-Example-Running-Behind-a-HTTP-Proxy-server-tf2270077.html#a6300962
Sent from the ServiceMix - User forum at Nabble.com.


Re: Http-Binding Example Running Behind a HTTP Proxy server

Posted by Steven <st...@assurant.com>.
Fortunately for me my proxy doesn't require a username and password. 
However, at my last place of work they did require a username and password
and it was a real pain in the ars. The credentials had to be encoded before
passing to the proxy (base64).  I could only figure out how to use
httpclient to get it to work.  I never got the jvm property settings
approach to work.  If I find some info on this, I'll be sure to post another
reply.



zul wrote:
> 
> Hi,
> 
> I was just wandering if your http proxy uses a username and password to
> provide authentication (because I didn't see the properties to set those
> items in your config) ?
> 
> Thanks,
>   zul
> 
> 
> Steven wrote:
>> 
>> 
>> I had the same problem with the rss-binding example.  If you're behind a
>> firewall, there is little to no information on how to configure
>> ServiceMix examples to work in this situation.  I had a brain fart this
>> morning and remembered reading a web page somewhere that talked about
>> setting httpProxy properties on the command line of the JVM.  I found the
>> following URL: 
>> 
>> http://developerlife.com/lessons/jvmfirewalltunelling/default.htm
>> 
>> So then I moodified the BAT file in the bin directory to include the
>> proxy properties: 
>> 
>> set DEFAULT_JAVA_OPTS=-server -Xmx512M
>> -Dderby.system.home="%SERVICEMIX_HOME%\var"
>> -Dderby.storage.fileSyncTransactionLog=true
>> -Dcom.sun.management.jmxremote -Dhttp.proxyHost=(my proxy host)
>> -Dhttp.proxyPort=3(my proxy port)
>> 
>> 
>> That fixed it and the rss-binding example works flawlessly now.  I hope
>> this works for you too.
>> 
>> 
>> 
>> 
>> zul wrote:
>>> 
>>> Hi,
>>> 
>>> It seems that running the http-binding example behind a http proxy
>>> server have a connection time-out problem. Where do I set the http proxy
>>> properties (such as proxyhost, proxyport, user, password) for connecting
>>> to the external server ("http://64.124.140.30:9090/soap") and what is
>>> the properties name or is it set (have to hardcode) at the sending
>>> server program file ?
>>> 
>>> Thankx.
>>> 
>>> Regards,
>>>    Zul
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Http-Binding-Example-Running-Behind-a-HTTP-Proxy-server-tf2270077.html#a6388856
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Http-Binding Example Running Behind a HTTP Proxy server

Posted by laz <la...@gmail.com>.
There is not any one particular file that needs to be changed. What needs to
occur is that the code that sets the default Authenticator used by
HttpURLConnection needs to be setup in a manner similar to the following:

Authenticator.setDefault(new MyAuthenticator());

Any Java code that is loaded into that JVM will do. It only needs to be done
once, so a good place might be a static initializer or some other method
that gets invoked as part of initialization.


zul wrote:
> 
> Hi,
> 
> Just wandering the filename that need to be amended.
> 
> Thanks,
>   zul
> 
> 
> laz wrote:
>> 
>> Check out http://floatingsun.net/articles/java-proxy.html for information
>> about accessing an authenticated proxy within Java. I have had success
>> using the technique described as "Java 2 Native Support".
>> 
>> 
>> zul wrote:
>>> 
>>> Hi,
>>> 
>>> I was just wandering if your http proxy uses a username and password to
>>> provide authentication (because I didn't see the properties to set those
>>> items in your config) ?
>>> 
>>> Thanks,
>>>   zul
>>> 
>>> 
>>> Steven wrote:
>>>> 
>>>> 
>>>> I had the same problem with the rss-binding example.  If you're behind
>>>> a firewall, there is little to no information on how to configure
>>>> ServiceMix examples to work in this situation.  I had a brain fart this
>>>> morning and remembered reading a web page somewhere that talked about
>>>> setting httpProxy properties on the command line of the JVM.  I found
>>>> the following URL: 
>>>> 
>>>> http://developerlife.com/lessons/jvmfirewalltunelling/default.htm
>>>> 
>>>> So then I moodified the BAT file in the bin directory to include the
>>>> proxy properties: 
>>>> 
>>>> set DEFAULT_JAVA_OPTS=-server -Xmx512M
>>>> -Dderby.system.home="%SERVICEMIX_HOME%\var"
>>>> -Dderby.storage.fileSyncTransactionLog=true
>>>> -Dcom.sun.management.jmxremote -Dhttp.proxyHost=(my proxy host)
>>>> -Dhttp.proxyPort=3(my proxy port)
>>>> 
>>>> 
>>>> That fixed it and the rss-binding example works flawlessly now.  I hope
>>>> this works for you too.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> zul wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> It seems that running the http-binding example behind a http proxy
>>>>> server have a connection time-out problem. Where do I set the http
>>>>> proxy properties (such as proxyhost, proxyport, user, password) for
>>>>> connecting to the external server ("http://64.124.140.30:9090/soap")
>>>>> and what is the properties name or is it set (have to hardcode) at the
>>>>> sending server program file ?
>>>>> 
>>>>> Thankx.
>>>>> 
>>>>> Regards,
>>>>>    Zul
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Http-Binding-Example-Running-Behind-a-HTTP-Proxy-server-tf2270077.html#a6450222
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Http-Binding Example Running Behind a HTTP Proxy server

Posted by zul <mu...@hotmail.com>.
Hi,

Just wandering the filename that need to be amended.

Thanks,
  zul


laz wrote:
> 
> Check out http://floatingsun.net/articles/java-proxy.html for information
> about accessing an authenticated proxy within Java. I have had success
> using the technique described as "Java 2 Native Support".
> 
> 
> zul wrote:
>> 
>> Hi,
>> 
>> I was just wandering if your http proxy uses a username and password to
>> provide authentication (because I didn't see the properties to set those
>> items in your config) ?
>> 
>> Thanks,
>>   zul
>> 
>> 
>> Steven wrote:
>>> 
>>> 
>>> I had the same problem with the rss-binding example.  If you're behind a
>>> firewall, there is little to no information on how to configure
>>> ServiceMix examples to work in this situation.  I had a brain fart this
>>> morning and remembered reading a web page somewhere that talked about
>>> setting httpProxy properties on the command line of the JVM.  I found
>>> the following URL: 
>>> 
>>> http://developerlife.com/lessons/jvmfirewalltunelling/default.htm
>>> 
>>> So then I moodified the BAT file in the bin directory to include the
>>> proxy properties: 
>>> 
>>> set DEFAULT_JAVA_OPTS=-server -Xmx512M
>>> -Dderby.system.home="%SERVICEMIX_HOME%\var"
>>> -Dderby.storage.fileSyncTransactionLog=true
>>> -Dcom.sun.management.jmxremote -Dhttp.proxyHost=(my proxy host)
>>> -Dhttp.proxyPort=3(my proxy port)
>>> 
>>> 
>>> That fixed it and the rss-binding example works flawlessly now.  I hope
>>> this works for you too.
>>> 
>>> 
>>> 
>>> 
>>> zul wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> It seems that running the http-binding example behind a http proxy
>>>> server have a connection time-out problem. Where do I set the http
>>>> proxy properties (such as proxyhost, proxyport, user, password) for
>>>> connecting to the external server ("http://64.124.140.30:9090/soap")
>>>> and what is the properties name or is it set (have to hardcode) at the
>>>> sending server program file ?
>>>> 
>>>> Thankx.
>>>> 
>>>> Regards,
>>>>    Zul
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Http-Binding-Example-Running-Behind-a-HTTP-Proxy-server-tf2270077.html#a6421012
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Http-Binding Example Running Behind a HTTP Proxy server

Posted by laz <la...@gmail.com>.
In the code at that link, the line 

Authenticator.setDefault(new MyAuthenticator());

Implies that any java.net.HttpURLConnection object in that running JVM will
use the credentials supplied by that Authenticator to connect to the proxy
server setup through System.properties.

See http://www.developer.com/java/other/article.php/1551421 for another
example.

This can only be done in Java code so you will need to have some component
execute this code. It only needs to be done once, so a good place might be a
static initializer or some other method that gets invoked as part of
initialization.


Steven wrote:
> 
> The only problem I see is that I'm working with an XML file where I send
> in properties to an already coded httpclient app, the HTTP servicemix
> component.  So how does one tell the component or the JVM to use
> creditials for an authenticated proxy.  It's easy enough to tell the JVM
> to use a proxy server, but I don't see how to tell it a usrname and
> password to use when that proxy server requires them.  Again, from code
> this is easy, but what happens when you need the servicemix http component
> to use it?  
> 
> 
> 
> laz wrote:
>> 
>> Check out http://floatingsun.net/articles/java-proxy.html for information
>> about accessing an authenticated proxy within Java. I have had success
>> using the technique described as "Java 2 Native Support".
>> 
>> 
>> zul wrote:
>>> 
>>> Hi,
>>> 
>>> I was just wandering if your http proxy uses a username and password to
>>> provide authentication (because I didn't see the properties to set those
>>> items in your config) ?
>>> 
>>> Thanks,
>>>   zul
>>> 
>>> 
>>> Steven wrote:
>>>> 
>>>> 
>>>> I had the same problem with the rss-binding example.  If you're behind
>>>> a firewall, there is little to no information on how to configure
>>>> ServiceMix examples to work in this situation.  I had a brain fart this
>>>> morning and remembered reading a web page somewhere that talked about
>>>> setting httpProxy properties on the command line of the JVM.  I found
>>>> the following URL: 
>>>> 
>>>> http://developerlife.com/lessons/jvmfirewalltunelling/default.htm
>>>> 
>>>> So then I moodified the BAT file in the bin directory to include the
>>>> proxy properties: 
>>>> 
>>>> set DEFAULT_JAVA_OPTS=-server -Xmx512M
>>>> -Dderby.system.home="%SERVICEMIX_HOME%\var"
>>>> -Dderby.storage.fileSyncTransactionLog=true
>>>> -Dcom.sun.management.jmxremote -Dhttp.proxyHost=(my proxy host)
>>>> -Dhttp.proxyPort=3(my proxy port)
>>>> 
>>>> 
>>>> That fixed it and the rss-binding example works flawlessly now.  I hope
>>>> this works for you too.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> zul wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> It seems that running the http-binding example behind a http proxy
>>>>> server have a connection time-out problem. Where do I set the http
>>>>> proxy properties (such as proxyhost, proxyport, user, password) for
>>>>> connecting to the external server ("http://64.124.140.30:9090/soap")
>>>>> and what is the properties name or is it set (have to hardcode) at the
>>>>> sending server program file ?
>>>>> 
>>>>> Thankx.
>>>>> 
>>>>> Regards,
>>>>>    Zul
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Http-Binding-Example-Running-Behind-a-HTTP-Proxy-server-tf2270077.html#a6450210
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Http-Binding Example Running Behind a HTTP Proxy server

Posted by Steven <st...@assurant.com>.
The only problem I see is that I'm working with an XML file where I send in
properties to an already coded httpclient app, the HTTP servicemix
component.  So how does one tell the component or the JVM to use creditials
for an authenticated proxy.  It's easy enough to tell the JVM to use a proxy
server, but I don't see how to tell it a usrname and password to use when
that proxy server requires them.  Again, from code this is easy, but what
happens when you need the servicemix http component to use it?  



laz wrote:
> 
> Check out http://floatingsun.net/articles/java-proxy.html for information
> about accessing an authenticated proxy within Java. I have had success
> using the technique described as "Java 2 Native Support".
> 
> 
> zul wrote:
>> 
>> Hi,
>> 
>> I was just wandering if your http proxy uses a username and password to
>> provide authentication (because I didn't see the properties to set those
>> items in your config) ?
>> 
>> Thanks,
>>   zul
>> 
>> 
>> Steven wrote:
>>> 
>>> 
>>> I had the same problem with the rss-binding example.  If you're behind a
>>> firewall, there is little to no information on how to configure
>>> ServiceMix examples to work in this situation.  I had a brain fart this
>>> morning and remembered reading a web page somewhere that talked about
>>> setting httpProxy properties on the command line of the JVM.  I found
>>> the following URL: 
>>> 
>>> http://developerlife.com/lessons/jvmfirewalltunelling/default.htm
>>> 
>>> So then I moodified the BAT file in the bin directory to include the
>>> proxy properties: 
>>> 
>>> set DEFAULT_JAVA_OPTS=-server -Xmx512M
>>> -Dderby.system.home="%SERVICEMIX_HOME%\var"
>>> -Dderby.storage.fileSyncTransactionLog=true
>>> -Dcom.sun.management.jmxremote -Dhttp.proxyHost=(my proxy host)
>>> -Dhttp.proxyPort=3(my proxy port)
>>> 
>>> 
>>> That fixed it and the rss-binding example works flawlessly now.  I hope
>>> this works for you too.
>>> 
>>> 
>>> 
>>> 
>>> zul wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> It seems that running the http-binding example behind a http proxy
>>>> server have a connection time-out problem. Where do I set the http
>>>> proxy properties (such as proxyhost, proxyport, user, password) for
>>>> connecting to the external server ("http://64.124.140.30:9090/soap")
>>>> and what is the properties name or is it set (have to hardcode) at the
>>>> sending server program file ?
>>>> 
>>>> Thankx.
>>>> 
>>>> Regards,
>>>>    Zul
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Http-Binding-Example-Running-Behind-a-HTTP-Proxy-server-tf2270077.html#a6433336
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Http-Binding Example Running Behind a HTTP Proxy server

Posted by laz <la...@gmail.com>.
Check out http://floatingsun.net/articles/java-proxy.html for information
about accessing an authenticated proxy within Java. I have had success using
the technique described as "Java 2 Native Support".


zul wrote:
> 
> Hi,
> 
> I was just wandering if your http proxy uses a username and password to
> provide authentication (because I didn't see the properties to set those
> items in your config) ?
> 
> Thanks,
>   zul
> 
> 
> Steven wrote:
>> 
>> 
>> I had the same problem with the rss-binding example.  If you're behind a
>> firewall, there is little to no information on how to configure
>> ServiceMix examples to work in this situation.  I had a brain fart this
>> morning and remembered reading a web page somewhere that talked about
>> setting httpProxy properties on the command line of the JVM.  I found the
>> following URL: 
>> 
>> http://developerlife.com/lessons/jvmfirewalltunelling/default.htm
>> 
>> So then I moodified the BAT file in the bin directory to include the
>> proxy properties: 
>> 
>> set DEFAULT_JAVA_OPTS=-server -Xmx512M
>> -Dderby.system.home="%SERVICEMIX_HOME%\var"
>> -Dderby.storage.fileSyncTransactionLog=true
>> -Dcom.sun.management.jmxremote -Dhttp.proxyHost=(my proxy host)
>> -Dhttp.proxyPort=3(my proxy port)
>> 
>> 
>> That fixed it and the rss-binding example works flawlessly now.  I hope
>> this works for you too.
>> 
>> 
>> 
>> 
>> zul wrote:
>>> 
>>> Hi,
>>> 
>>> It seems that running the http-binding example behind a http proxy
>>> server have a connection time-out problem. Where do I set the http proxy
>>> properties (such as proxyhost, proxyport, user, password) for connecting
>>> to the external server ("http://64.124.140.30:9090/soap") and what is
>>> the properties name or is it set (have to hardcode) at the sending
>>> server program file ?
>>> 
>>> Thankx.
>>> 
>>> Regards,
>>>    Zul
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Http-Binding-Example-Running-Behind-a-HTTP-Proxy-server-tf2270077.html#a6400770
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Http-Binding Example Running Behind a HTTP Proxy server

Posted by zul <mu...@hotmail.com>.
Hi,

I was just wandering if your http proxy uses a username and password to
provide authentication (because I didn't see the properties to set those
items in your config) ?

Thanks,
  zul


Steven wrote:
> 
> 
> I had the same problem with the rss-binding example.  If you're behind a
> firewall, there is little to no information on how to configure ServiceMix
> examples to work in this situation.  I had a brain fart this morning and
> remembered reading a web page somewhere that talked about setting
> httpProxy properties on the command line of the JVM.  I found the
> following URL: 
> 
> http://developerlife.com/lessons/jvmfirewalltunelling/default.htm
> 
> So then I moodified the BAT file in the bin directory to include the proxy
> properties: 
> 
> set DEFAULT_JAVA_OPTS=-server -Xmx512M
> -Dderby.system.home="%SERVICEMIX_HOME%\var"
> -Dderby.storage.fileSyncTransactionLog=true -Dcom.sun.management.jmxremote
> -Dhttp.proxyHost=(my proxy host) -Dhttp.proxyPort=3(my proxy port)
> 
> 
> That fixed it and the rss-binding example works flawlessly now.  I hope
> this works for you too.
> 
> 
> 
> 
> zul wrote:
>> 
>> Hi,
>> 
>> It seems that running the http-binding example behind a http proxy server
>> have a connection time-out problem. Where do I set the http proxy
>> properties (such as proxyhost, proxyport, user, password) for connecting
>> to the external server ("http://64.124.140.30:9090/soap") and what is the
>> properties name or is it set (have to hardcode) at the sending server
>> program file ?
>> 
>> Thankx.
>> 
>> Regards,
>>    Zul
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Http-Binding-Example-Running-Behind-a-HTTP-Proxy-server-tf2270077.html#a6383947
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Http-Binding Example Running Behind a HTTP Proxy server

Posted by Steven <st...@assurant.com>.

I had the same problem with the rss-binding example.  If you're behind a
firewall, there is little to no information on how to configure ServiceMix
examples to work in this situation.  I had a brain fart this morning and
remembered reading a web page somewhere that talked about setting httpProxy
properties on the command line of the JVM.  I found the following URL: 

http://developerlife.com/lessons/jvmfirewalltunelling/default.htm

So then I moodified the BAT file in the bin directory to include the proxy
properties: 

set DEFAULT_JAVA_OPTS=-server -Xmx512M
-Dderby.system.home="%SERVICEMIX_HOME%\var"
-Dderby.storage.fileSyncTransactionLog=true -Dcom.sun.management.jmxremote
-Dhttp.proxyHost=(my proxy host) -Dhttp.proxyPort=3(my proxy port)


That fixed it and the rss-binding example works flawlessly now.  I hope this
works for you too.




zul wrote:
> 
> Hi,
> 
> It seems that running the http-binding example behind a http proxy server
> have a connection time-out problem. Where do I set the http proxy
> properties (such as proxyhost, proxyport, user, password) for connecting
> to the external server ("http://64.124.140.30:9090/soap") and what is the
> properties name or is it set (have to hardcode) at the sending server
> program file ?
> 
> Thankx.
> 
> Regards,
>    Zul
> 

-- 
View this message in context: http://www.nabble.com/Http-Binding-Example-Running-Behind-a-HTTP-Proxy-server-tf2270077.html#a6306378
Sent from the ServiceMix - User forum at Nabble.com.


Re: Http-Binding Example Running Behind a HTTP Proxy server

Posted by pradeep <pr...@gmail.com>.
I dont think "http://64.124.140.30:9090/soap" works. When I type in the
browser I get error.

zul wrote:
> 
> Hi,
> 
> It seems that running the http-binding example behind a http proxy server
> have a connection time-out problem. Where do I set the http proxy
> properties (such as proxyhost, proxyport, user, password) for connecting
> to the external server ("http://64.124.140.30:9090/soap") and what is the
> properties name or is it set (have to hardcode) at the sending server
> program file ?
> 
> Thankx.
> 
> Regards,
>    Zul
> 

-- 
View this message in context: http://www.nabble.com/Http-Binding-Example-Running-Behind-a-HTTP-Proxy-server-tf2270077.html#a6302735
Sent from the ServiceMix - User forum at Nabble.com.