Proxy confusion

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Proxy confusion

Tom Grahame
I have an Orbeon Xforms application that uses a processor to generate XML from a struts application that sits inside the same context. The processor works well and the config looks something like this:

<config>
        <url>http://127.0.0.1/orbeon/addPublicationSetup.do</url>
</config>

Then a similar processor inside Orbeon needs to access an external service and I know that my network setup requires me to go through a proxy, so I configure my properties-base.xml to do so.
The external service processor now works well, however I have now broken the processor accessing the struts action. My proxy service returns a message that it can't retrieve the URL http://127.0.0.1/orbeon/addPublicationSetup.do and understandably so.

I'd like to configure my setup to use the proxy service and access struts actions on localhost. Can anyone give me any pointers as to how to do this? I suspect that I'm missing something fairly fundamental yet simple. I'm running Orbeon Forms dev-3.7.1.200904170159, Tomcat5.5 and I am also using Apache2 as a front end with mod_rewrite.

Thanks,

Tom
Reply | Threaded
Open this post in threaded view
|

Re: Proxy confusion

Alessandro Vernet
Administrator
Tom,

On Apr 29, 2009, at 3:13 AM, Tom Grahame wrote:

> I have an Orbeon Xforms application that uses a processor to  
> generate XML
> from a struts application that sits inside the same context. The  
> processor
> works well and the config looks something like this:
>
> <config>
> <url>http://127.0.0.1/orbeon/addPublicationSetup.do</url>
> </config>

I would say that this is a bug. We are using the Apache HttpClient  
library and even if there is a proxy setup, that proxy should not be  
used if the host is localhost or 127.0.0.1. Now if HttpClient isn't  
doing it, we could do this in Orbeon Forms and just not tell  
HttpClient about the proxy of the host is localhost or 127.0.0.1.

A workaround (which would anyway be my preferred way of doing this),  
is to use an xforms:submission instead of the URL generator. In this  
case you can use resource="/addPublicationSetup.do" without having to  
specify the host. Is that doable in your case?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Proxy confusion

Tom Grahame
Hi Alex,

Thanks very much for your response. It is doable - I have changed the processor to oxf:xforms-submission and configured it as follows:

<p:processor name="oxf:xforms-submission">
        <p:input name="submission">
                <xforms:submission method="get" resource="/addPublicationSetup.do"/>
        </p:input>
        <p:input name="request">
                <data/>
        </p:input>
        <p:output name="response" id="nextPid"/>
</p:processor>

Now in my orbeon logs I see:

DEBUG XFormsServer  - XForms - connection - opening URL connection {URL: "http://www.hostname-that-the-world-sees/orbeon/addPublicationSetup.do"}
INFO  HttpMethodDirector  - I/O exception (java.net.ConnectException) caught when processing request: Connection timed out
INFO  HttpMethodDirector  - Retrying request

Then I remember that the reason I am even doing this is because I need to use the proxy service... So I configure Orbeon to use the proxy, try the submission again and the proxy says it can't access the above URL; the problem seems now to be the proxy server and not Orbeon....

And this isn't really the place for help on configuring proxies, unless anyone has any advice anyway...?

Thanks again,

Tom

Alessandro Vernet wrote
A workaround (which would anyway be my preferred way of doing this),  
is to use an xforms:submission instead of the URL generator. In this  
case you can use resource="/addPublicationSetup.do" without having to  
specify the host. Is that doable in your case?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: Proxy confusion

Tom Grahame
Update in case anyone is following this:

The final problem was a misconfigured proxy server, NOT Orbeon.

Configured to use a proxy, Orbeon appears to send all http traffic out through it. Whether this is right or not (in the case of localhost requests), this is indeed what the documentation says does happen -

http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties#TOC-Proxy-setup

I am now revisiting the areas in my application where I use an oxf:url-generator processor and seeing if I can use an oxf:submission-processor instead - as Alex says this is probably preferable. Ahem.

Tom

Tom Grahame wrote
the problem seems now to be the proxy server and not Orbeon....

And this isn't really the place for help on configuring proxies, unless anyone has any advice anyway...?
Reply | Threaded
Open this post in threaded view
|

Re: Proxy confusion

Alessandro Vernet
Administrator
In reply to this post by Tom Grahame
Tom,

Tom,

Tom Grahame wrote
Now in my orbeon logs I see:

DEBUG XFormsServer  - XForms - connection - opening URL connection {URL: "http://www.hostname-that-the-world-sees/orbeon/addPublicationSetup.do"}
INFO  HttpMethodDirector  - I/O exception (java.net.ConnectException) caught when processing request: Connection timed out
Right, when you use an absolute path the code adds the hostname and context used in the request it received (not localhost). That means that your request will "go out" again, and that in this case at least you can make it work with the proper configuration on your proxy. Thank you for the update on this.

Alex