You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by fachhoch <fa...@gmail.com> on 2010/03/23 00:15:38 UTC

client address when client and serverare in one war file

my client and my server both are in the same war file , in the same jvm.
Is there any way I can tell  client to use the context root  of my webapp 
for the address   of

for example

<jaxws:client id="findGrantsClient"
serviceClass="service.GrantsSearchService" 
address="<contextroot>/cxf/findGrants">
<contextroot>  is the context of my web application ?

-- 
View this message in context: http://old.nabble.com/client-address-when-client-and-serverare-in-one-war-file-tp27994128p27994128.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: client address when client and serverare in one war file

Posted by Daniel Kulp <dk...@apache.org>.
On Monday 22 March 2010 7:15:38 pm fachhoch wrote:
> my client and my server both are in the same war file , in the same jvm.
> Is there any way I can tell  client to use the context root  of my webapp
> for the address   of
> 
> for example
> 
> <jaxws:client id="findGrantsClient"
> serviceClass="service.GrantsSearchService"
> address="<contextroot>/cxf/findGrants">
> <contextroot>  is the context of my web application ?


Since at startup, we don't really know the port or anything, there really 
isn't anything that can be put there.   You'll definitely need to set this 
programatically in the code via the ENDPOINT_ADDRESS_URL thing.

The BETTER alternative (though I admit to not actually knowing much about 
this) would be to enable the coloc feature on the bus  (feature bean class of 
org.apache.cxf.binding.coloc.feature.ColocFeature) which would try and detect 
if client and service are in the same bus and would bypass the entire HTTP 
marshalling and such.    Either that or register the service on both the http 
address as well as a "local" address (our local transport) and use the local 
address in the jaxws:client.   

One reason for that is to avoid potential deadlocks.   For example, lets say 
the container is set to have a max thread queue length of 50.   If 50 requests 
come in at once, and all 50 threads create/use a client configured to hit 
localhost or similar, there are no threads left to process their requests to 
everything deadlocks (until the clients start timing out).

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: client address when client and serverare in one war file

Posted by Glen Mazza <gl...@gmail.com>.
I don't know how to do that, but you know you have the
ENDPOINT_ADDRESS_PROPERTY[1] as a fallback if that can help you.

HTH,
Glen

[1] http://www.jroller.com/gmazza/entry/soap_client_tutorial (step #6)


fachhoch wrote:
> 
> my client and my server both are in the same war file , in the same jvm.
> Is there any way I can tell  client to use the context root  of my webapp 
> for the address   of
> 
> for example
> 
> <jaxws:client id="findGrantsClient"
> serviceClass="service.GrantsSearchService" 
> address="<contextroot>/cxf/findGrants">
> <contextroot>  is the context of my web application ?
> 

-- 
View this message in context: http://old.nabble.com/client-address-when-client-and-serverare-in-one-war-file-tp27994128p28006833.html
Sent from the cxf-user mailing list archive at Nabble.com.