Daemonite: Web services from behind a proxy Archive

Daemonite: Web services from behind a proxy Archive


Monday, July 08, 2002
Web services from behind a proxy

Ever wondered whether it's possible to consume a web service in CFMX from behind a proxy server? The <CFINVOKE> tag doesn't appear to have the required attributes, and there isn't anything in the documentation but here's how...

MM engineering point out that consuming web services from behind proxy servers isn't officially supported in the initial release of CFMX. However, the feature is slated for inclusion in SP1. In the interim here's a workaround that you might try.

Before calling the <CFINVOKE> tag, include this Java code:

<cfscript>
obj = CreateObject("java", "java.lang.System");
obj.setProperty("http.proxyHost", "your_proxy_host");
obj.setProperty("http.proxyPort", "your_proxy_port");
</cfscript>

I don't have a proxy server to test with, so if anyone feels inclined to try this out let us know how you go...

Many thanks to David Gassner, for passing this on.


Posted by modius at 08:52 PM | Permalink
Trackback: http://blog.daemon.com.au/cgi-bin/dmblog/mt-tb.cgi/13

Comments

I utilized your proxy server identification code above and now my web services will work. Question to anyone else out there, I have not gotten webservices to run when not connected to a network. Any ideas as to why? Thanks,

Phil

Posted by: Phillip Duba on July 20, 2002 12:05 AM

This is not working for me I have to provide my firewall with a username and password. I tried to add them using obj.setProperty, but this still seems to fail. Any ideas?

Posted by: martin on August 1, 2002 10:00 AM

Sorry, not sure you have any options left. You might try submitting a feature request ASAP as rumour has it this is slated for SP1 release.
http://www.macromedia.com/support/email/wishform/

Posted by: Geoff Bowers on August 1, 2002 10:58 AM

i need to talk to phillip duba,, how do i get in touch with him / by email, etc

Posted by: amcheeks on January 29, 2003 11:40 AM

Saw an interesting variation to this theme in a forum the other day that lets you set proxy values server wide --
Try adding the following Java Arguments using the administrator's Java and JVM page:
-Dhttp.proxyHost=myproxy.foo.com -Dhttp.proxyPort=80

Posted by: Geoff Bowers on February 9, 2003 05:27 PM

Thank you very much: this stuff worked for us:


obj = CreateObject("java", "java.lang.System");
obj.setProperty("http.proxyHost", "your_proxy_host");
obj.setProperty("http.proxyPort", "your_proxy_port");


one trick: when you specify a proxy, just put the name like "proxy105" not "http://proxy105"

Posted by: Lena on June 6, 2003 04:21 AM

Hopefully this isn't as stupid of a question as i think it is...

but is there comparable code that I can use in CF 5? I'm using the soxml tag to consume an XML feed...but being behind the proxy ain't working.

i have an MX install, and the code above works fine...but not for CF 5. I assume i need some kind of comparable COM object instead of java?

thx!

Posted by: charlie on July 22, 2003 04:52 AM