Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 36923 invoked from network); 15 Feb 2011 19:03:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Feb 2011 19:03:37 -0000 Received: (qmail 70303 invoked by uid 500); 15 Feb 2011 19:03:37 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 69990 invoked by uid 500); 15 Feb 2011 19:03:34 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 69983 invoked by uid 99); 15 Feb 2011 19:03:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 19:03:33 +0000 X-ASF-Spam-Status: No, hits=3.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dave.horsey66@gmail.com designates 74.125.82.50 as permitted sender) Received: from [74.125.82.50] (HELO mail-ww0-f50.google.com) (74.125.82.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 19:03:26 +0000 Received: by wwf26 with SMTP id 26so497599wwf.31 for ; Tue, 15 Feb 2011 11:03:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=pi2fwvS5dokp2ExHHmFAW6nb2C0+biptZyv5w/dbPno=; b=fA8LJsSYf2eI7YR667IVVd2JkSdntt2ZVlYY2cZTRBZL8SCUwg9sPrPE3hTCb+omVP Mn5Sd1ZtyCl5bQMHNETIRUvQrf0ga+xsaoIlQAk8GggHmfsGCawluO+oUJY1xsP1plIq PUZrnIrED2DCDBGsveIBoaAv4+DWXNiRo9DEU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=WyPism8s7JvQlxv0oSnpdsw1p8QLLJm586EB7ZPhb6HElJWYPRn1wTUCBE16DksseX E/Y5GtwUlw5nKWrjdDgSKazRxgiPQFX7oizd4bjimSVdPF3qQahgZASUtcrbwKbBWvQj II0oOqv33tYfu1vjT3gQf5eIDM9kUcoL3sY8Y= MIME-Version: 1.0 Received: by 10.227.155.138 with SMTP id s10mr4026582wbw.36.1297796585284; Tue, 15 Feb 2011 11:03:05 -0800 (PST) Received: by 10.227.156.83 with HTTP; Tue, 15 Feb 2011 11:03:05 -0800 (PST) In-Reply-To: References: <801097EE-99D2-4ABA-9941-B1500F659F2D@yahoo.com> Date: Tue, 15 Feb 2011 19:03:05 +0000 Message-ID: Subject: Re: Configuring front end host for axis2 web services From: Dave Horsey To: dev@geronimo.apache.org Content-Type: multipart/alternative; boundary=0016e65a01b274e7bb049c56d0ef --0016e65a01b274e7bb049c56d0ef Content-Type: text/plain; charset=ISO-8859-1 I may be wrong about this, but I believe cxf defines an endpointURL value which overrides the default behaviour with respect to wsdl/soap:address. I did a bit of reading around this a month or two back, and it seemed to be pretty well documented. Cheers Dave On Tue, Feb 15, 2011 at 8:54 AM, David Jencks wrote: > Sorry for the delay. > > We might look at what cxf does in this situation since they certainly have > more ws experience than I do :-) > > I think we should consider configuring geronimo rather than the proxy > servers. After discussing this a bit with ashish I think the following > might work: > > define a wsdl rewriting service (gbean for g 2.x) that can be configured > with the header containing the actual host/port and by default uses the > httpd X-Forwarded-Host. (if the header isn't present it uses the host from > the request as at present). > > The ws-specific object gets a reference to this service (gbean) and has it > do the rewriting. > > We can presumably use the same code for axis2, cxf (if necessary) and > axis1. > > Comments? > > thanks > david jencks > > On Feb 10, 2011, at 10:54 PM, Ashish Jain wrote: > > Hi David, > > Your bit on configuring the header can be another way. We can use a > standard header name for this for example FrontEnd-Proxy-HostPort or may be > some other name. HTTP Server provides a directive where custom headers can > be appended to the requests. > http://httpd.apache.org/docs/current/mod/mod_headers.html#requestheader > > I am very much hopeful that other HTTP servers will also provide a way to > configure custom headers. > So this option is also very much acceptable. > > Thanks > Ashish > > On Thu, Feb 10, 2011 at 10:44 PM, David Jencks wrote: > >> Hi Ashish, >> >> I was certainly thinking of X-Forwarded-Host. I'm not clear on whether >> this header includes the original port. Google hasn't shown me much info on >> how other people deal with this problem. I did find >> http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypreservehost >> >> which appears to indicate you can configure apache httpd to not introduce >> this problem in the first place. >> >> I can see that directly configuring the host would be useful in some >> circumstances, but I think it would be easier in more circumstances to be >> able to configure the header name for the original host. >> >> So I guess you are right and directly configuring the host is the best >> solution for now. I'll let you know if I can find any more information on >> this. >> >> thanks! >> david jencks >> >> On Feb 10, 2011, at 6:28 AM, Ashish Jain wrote: >> >> Hi David, >> >> I am not sure if we can use the request object. The request >> (org.apache.geronimo.webservices.WebServiceContainer.Request) object gives >> you the address for the remote host which is the address for the proxy >> server, however no information on the port. Another way could have been to >> utilize the header "request.getHeader("X-Forwarded-Host")" but this is not a >> standard header AFAIK. So this option can also to be ruled out. So I think >> modifying the schema is the best way ahead. >> >> Thanks >> Ashish >> >> On Tue, Feb 8, 2011 at 6:34 PM, Ashish Jain wrote: >> >>> Thanks David and Jarek. I am investigating on the comment made by David >>> and seems to have found some headers which are being appended by HTTP >>> server. I will investigate further in this direction to find out if the >>> request object can be used to attain this. >>> >>> Thanks >>> Ashish >>> >>> >>> On Tue, Feb 8, 2011 at 1:06 AM, David Jencks wrote: >>> >>>> Changing the schema like this shouldn't be a problem if its necessary. >>>> I'd like to understand better why its necessary. Perhaps there's another >>>> way. >>>> >>>> I thought that the way this was coded was that the host and port from >>>> the incoming request were stuffed into the wsdl being returned. Doesn't the >>>> proxy server tell us what the original request was in some way such as a >>>> request attribute? Could we look for that information and use it if >>>> available and use the request itself if not? >>>> >>>> thanks >>>> david jencks >>>> >>>> On Feb 7, 2011, at 10:39 AM, Jarek Gawor wrote: >>>> >>>> > Ashish, >>>> > >>>> > Modifying the schema (without changing the namespace) is fine as long >>>> > as you make the new element(s) optional. That at least is what we have >>>> > done in the past. >>>> > >>>> > Jarek >>>> > >>>> > On Fri, Jan 28, 2011 at 10:00 AM, Ashish Jain >>>> wrote: >>>> >> Hi, >>>> >> >>>> >> When geronimo is front ended with a proxy say Apache HTTP server and >>>> a web >>>> >> service is invoked via this proxy. The auto >>>> >> generated wsdl will have the soap:address as >>>> >> http://:/service_name. Instead it should be >>>> >> http://: >>>> >> /service_name. The method which takes care of all this is >>>> >> org.apache.geronimo.axis2.WSDLQueryHandler.writeResponse >>>> >> . The baseUri attribute in the class has to be modified so that >>>> appropriate >>>> >> soap:address can be written in the wsdl file. >>>> >> >>>> >> So as to get this property into geronimo one of the way would be to >>>> be able >>>> >> to specify in geronimo deployment descriptor. >>>> >> Adding a new attribute may require schema change. >>>> >> >>>> >> Is this acceptable? Are there any other alternative ways through >>>> which this >>>> >> can be achieved? >>>> >> >>>> >> Thanks >>>> >> Ashish >>>> >> >>>> >>>> >>> >> >> > > -- Cheers, Dave --0016e65a01b274e7bb049c56d0ef Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I may be wrong about this, but I believe cxf defines an endpointURL value w= hich overrides the default behaviour with respect to wsdl/soap:address.
=
I did a bit of reading around this a month or two back, and it seemed t= o be pretty well documented.

Cheers
Dave

On Tue, Feb 15, 2011 a= t 8:54 AM, David Jencks <david_jencks@yahoo.com> wrote:
Sorry for the delay.

We might look at what cxf does in this situation since they certainly ha= ve more ws experience than I do :-)

I think we sho= uld consider configuring geronimo rather than the proxy servers. =A0After d= iscussing this a bit with ashish I think the following might work:

define a wsdl rewriting service (gbean for g 2.x) that = can be configured with the header containing the actual host/port and by de= fault uses the httpd X-Forwarded-Host. (if the header isn't present it = uses the host from the request as at present).

The ws-specific object gets a reference to this service= (gbean) and has it do the rewriting. =A0

We can p= resumably use the same code for axis2, cxf (if necessary) and axis1.=A0

Comments?

thanks
dav= id jencks

On Feb = 10, 2011, at 10:54 PM, Ashish Jain wrote:

Hi David,

Your bit on configuring the header can be another way. We = can use a standard header name for this for example FrontEnd-Proxy-HostPort= or may be some other name. HTTP Server provides a directive where custom h= eaders can be appended to the requests.
http://httpd.apache.org/docs/current/mod/mod_hea= ders.html#requestheader

I am very much hopeful that other HTTP s= ervers will also provide a way to configure custom headers.
So this option is also very much acceptable.

Thanks
Ashish
On Thu, Feb 10, 2011 at 10:44 PM, David Jencks = <david_jencks@yahoo.com> wrote:
Hi Ashish,

I was certainly thinking= of X-Forwarded-Host. =A0I'm not clear on whether this header includes = the original port. =A0Google hasn't shown me much info on how other peo= ple deal with this problem. =A0I did find=A0

which appears= to indicate you can configure apache httpd to not introduce this problem i= n the first place.

I can see that directly configuring the host would be u= seful in some circumstances, but I think it would be easier in more circums= tances to be able to configure the header name for the original host.

So I guess you are right and directly configuring the h= ost is the best solution for now. =A0I'll let you know if I can find an= y more information on this.

thanks!
davi= d jencks

On Feb 10, 2011, at 6:28 AM, Ashish= Jain wrote:

Hi David,

I am not s= ure if we can use the request object. The request (org.apache.geronimo.webs= ervices.WebServiceContainer.Request) object gives you the address for the r= emote host which is the address for the proxy server, however no informatio= n on the port. Another way could have been to utilize the header "requ= est.getHeader("X-Forwarded-Host")" but this is not a standar= d header AFAIK. So this option can also to be ruled out. So I think modifyi= ng the schema is the best way ahead.

Thanks
Ashish

On Tue, Feb 8, 2011 = at 6:34 PM, Ashish Jain <ashjain2@gmail.com> wrote:
Thanks David and Jarek. I am investigating on the comment made by David and= seems to have found some headers which are being appended by HTTP server. = I will investigate further in this direction to find out if the request obj= ect can be used to attain this.

Thanks
Ashish

On Tue, Feb 8, 2011 at 1:06 AM, David Jenck= s <david_jencks@yahoo.com> wrote:
Changing the schema like this shouldn't be a problem if its necessary. = =A0I'd like to understand better why its necessary. =A0Perhaps there= 9;s another way.

I thought that the way this was coded was that the host and port from the i= ncoming request were stuffed into the wsdl being returned. =A0Doesn't t= he proxy server tell us what the original request was in some way such as a= request attribute? =A0Could we look for that information and use it if ava= ilable and use the request itself if not?

thanks
david jencks

On Feb 7, 2011, at 10:39 AM, Jarek Gawor wrote:

> Ashish,
>
> Modifying the schema (without changing the namespace) is fine as long<= br> > as you make the new element(s) optional. That at least is what we have=
> done in the past.
>
> Jarek
>
> On Fri, Jan 28, 2011 at 10:00 AM, Ashish Jain <ashjain2@gmail.com> wrote:
>> Hi,
>>
>> When geronimo is front ended with a proxy say Apache HTTP server a= nd a web
>> service is invoked via this proxy. The auto
>> generated wsdl will have the soap:address as
>> http://<g_host>:<g_port>/service_name. Instead it shou= ld be
>> http://<proxy_host>:
>> <proxy:port>/service_name. The method which takes care of al= l this is
>> org.apache.geronimo.axis2.WSDLQueryHandler.writeResponse
>> . The baseUri attribute in the class has to be modified so that ap= propriate
>> soap:address can be written in the wsdl file.
>>
>> So as to get this property into geronimo one of the way would be t= o be able
>> to specify in geronimo deployment descriptor.
>> Adding a new attribute may require schema change.
>>
>> Is this acceptable? Are there any other alternative ways through w= hich this
>> can be achieved?
>>
>> Thanks
>> Ashish
>>









--
Cheers,

Dave
--0016e65a01b274e7bb049c56d0ef--