Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 61002 invoked from network); 30 Mar 2007 13:32:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Mar 2007 13:32:29 -0000 Received: (qmail 72405 invoked by uid 500); 30 Mar 2007 13:32:35 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 72356 invoked by uid 500); 30 Mar 2007 13:32:35 -0000 Mailing-List: contact cxf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-dev@incubator.apache.org Received: (qmail 72347 invoked by uid 99); 30 Mar 2007 13:32:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2007 06:32:35 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of andrea.smyth@iona.com designates 62.221.12.33 as permitted sender) Received: from [62.221.12.33] (HELO emea-smg1.iona.com) (62.221.12.33) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2007 06:32:25 -0700 Received: from emea-ems1.ionaglobal.com (dutec.ie [10.2.1.125]) by emea-smg1.iona.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id l2UESltg020393 for ; Fri, 30 Mar 2007 14:28:47 GMT Received: from [10.5.2.195] ([10.5.2.195]) by emea-ems1.ionaglobal.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 30 Mar 2007 14:32:01 +0100 Message-ID: <460D111F.1000604@iona.com> Date: Fri, 30 Mar 2007 14:31:11 +0100 From: Andrea Smyth User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cxf-dev@incubator.apache.org Subject: Re: Why does ClientImpl.invoke() override the EndpointInfo address? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 30 Mar 2007 13:32:01.0534 (UTC) FILETIME=[CC5619E0:01C772CF] X-Virus-Checked: Checked by ClamAV on apache.org Glynn, Eoghan wrote: >Folks, > >Does anyone know why ClientImpl.invoke() overrides the EndpointInfo >address with the Message.ENDPOINT_ADDRESS property? > >This has the effect of making permanent any application-level overriding >of the BindingProvider.ENDPOINT_ADDRESS_PROPERTY. By permanent, I mean >applying to all subsequent invocations on this proxy, not just the >current one. > >This doesn't seem correct to me, as I'd expect it to be a one-shot >setting, i.e. applying only to a single invocation. Now the JAX-WS spec >doesn't make this explicit, but reading between the lines of say the >following FAQ entry[1] on jax-ws.dev.java.net suggests that's the >intention. > >So does anyone a) know why ClientImpl.invoke() calls >EndpointInfo.setAddress() and/or b) object to me removing this? > > Hi Eoghan, I'm not sure of the impact of removing the call to EndpointInfo.setAddress would be on the HTTPConduit: In its constructor, it initialises a URL with EndpointInfo.getAddress(). But from what I can see, this initialisation can be deferred, as in any case during send, the HTTPConduit calls into setupURL(), which overwrites this url with a possibly message specific one (so the conduit's behavior w.r.t message specific properties should actually be correct). EndpointInfo.getAddress() is also used by the policy interceptors - to match a domain expression in a PolicyAttachment against the current endpoint. http://localhost:9020/SoapContext/GreeterPort .... Basically, EndpointInfo is used as key to cache effective policies. We could change this to a key that is composed of EndpointInfo AND the address. Andrea. >When looking into this I noticed a couple of other bizzarro aspects of >the ENDPOINT_ADDRESS mechanism as currently implemented in CXF. > >1. the JaxWsClientProxy ctor sets >BindingProvider.ENDPOINT_ADDRESS_PROPERTY to the real EndpointInfo >address in the request context. But since the request context is cleared >between requests, this setting is only available (to logical handlers >etc.) for the *first* invocation on the proxy. Surely that's wrong, or? > >2. any overriding of the BindingProvider.ENDPOINT_ADDRESS_PROPERTY in a >JAX-WS LogicalHandler is ignored. This is because the >ContextPropertiesMapping..mapRequestfromJaxws2Cxf() is only called >upfront in the JaxWsClientProxy.invoke(), but not after the JAX-WS >handlers have been traversed. Surely that's wrong too, or? > >I'm open to correction from anyone with more insight into the intent of >the JAX-WS expert group. > >Cheers, >Eoghan > > >[1] https://jax-ws.dev.java.net/faq/index.html >"Q. How can I change the Web Service address dynamically for a request ? > >((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOIN >T_ADDRESS_PROPERTY, "...");" > >