You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "Glynn, Eoghan" <eo...@iona.com> on 2007/05/03 15:05:47 UTC

Pitfall to avoid with config


Folks,

Just in case anyone else makes the same dumb mistake and ends up tearing
out their hair as I did, here's a quick heads-up on an aspect of using
<jaxws:endpoint> bean to apply <jaxws:features> to individual endpoints
within a multi-endpoint service.

Basically you can no longer use instances of the *same* implementor
class to publish on the multiple endpoints. This is because the portName
attribute of the @WebService annotation is used to wire in the
<jaxws:endpoint> config. If this annotation is missing, then the port
name is inferred from the implementator class name. 

Either way, you're outta luck using the same implementor type for
different endpoints *and* picking up endpoint-specific config. Without
config, reusing the same implementor class for compatible ports still
works fine in CXF, though I guess someone may point out that it goes
against either the letter or the spirit of the JAX-WS spec.

Cheers,
Eoghan

RE: Pitfall to avoid with config

Posted by "Glynn, Eoghan" <eo...@iona.com>.

I guess I should explain a bit further the root of my confusion on this.

In the case of Endpoint.publish(), the thing that's actually created
from the API is not the implementor itself, as this is created directly
by the app in advance of the call to publish().

So the createdFromAPI attribute on <jaxws:endpoint> suggested to me the
physical endpoint (i.e. the Destination), which is actually created
directly as a result of the Endpoint.publish() call. The identity of
this Destination is given by the address param to passed to
Endpoint.publish(). So it seemed logical that this address should be
used to select the port, which would then be used to select the
<jaxws:endpoint> config ... as opposed to the @WebService(portName)
annotation on the implementor (which isn't actually created from API at
all).

But I guess the flaw in my reasoning is that the address may not
actually be associated with any pre-defined port ... i.e. it needn't
actually match the <soap:address location=.../> element of any port
defined in the WSDL.

Cheers,
Eoghan


> -----Original Message-----
> From: Glynn, Eoghan [mailto:eoghan.glynn@iona.com] 
> Sent: 03 May 2007 14:06
> To: cxf-dev@incubator.apache.org
> Subject: Pitfall to avoid with <jaxws:endpoint> config
> 
> 
> 
> Folks,
> 
> Just in case anyone else makes the same dumb mistake and ends 
> up tearing out their hair as I did, here's a quick heads-up 
> on an aspect of using <jaxws:endpoint> bean to apply 
> <jaxws:features> to individual endpoints within a 
> multi-endpoint service.
> 
> Basically you can no longer use instances of the *same* 
> implementor class to publish on the multiple endpoints. This 
> is because the portName attribute of the @WebService 
> annotation is used to wire in the <jaxws:endpoint> config. If 
> this annotation is missing, then the port name is inferred 
> from the implementator class name. 
> 
> Either way, you're outta luck using the same implementor type 
> for different endpoints *and* picking up endpoint-specific 
> config. Without config, reusing the same implementor class 
> for compatible ports still works fine in CXF, though I guess 
> someone may point out that it goes against either the letter 
> or the spirit of the JAX-WS spec.
> 
> Cheers,
> Eoghan
>