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 [email protected] http://dankulp.com/blog
