Hi Gilles,

Do you need to use the Client to invoke the service in your unit test?
If so , you need to use the below code to trigger the LocalConduit direct 
dispatch.

Willem.


-----Original Message-----
From: Gilles Durys [mailto:[EMAIL PROTECTED]
Sent: Thu 9/20/2007 20:13
To: [email protected]
Subject: Re: JUnit test with local transport failing to find hibernate session
 
Willem Jiang wrote:
> Hi
> I just went through the code and Xfire JIRA, it may relate to the
> different send and receive thread on the client side.
> You just need to add this pair
> ("org.apache.cxf.transport.local.LocalConduit.directDispatch, true) in
> your request context,
> to let the LocalConduit not fork a new thread to receive the message.
> Here is a code snippet to show you how to set the request message context.
> 
>            HelloWorldPortType greeter = service.getPort(portName,
> HelloWorldPortType.class);
>            InvocationHandler handler  =
> Proxy.getInvocationHandler(greeter);
>            BindingProvider  bp = null;
>                      if (handler instanceof BindingProvider) {
>                bp = (BindingProvider)handler;             
>                Map<String, Object> requestContext =
> bp.getRequestContext();                           
> requestContext.put(LocalConduit.DIRECT_DISPATCH, true);
>            }
> 
Thank you for your advice.
But my service is an instance of org.apache.cxf.jaxws.EndpointImpl so
this snippet doesn't work.


-- 
Gilles Durys

Developer

Work   : +32 10 83 21 12
Mobile : +32 498 88 21 12
E-mail : [EMAIL PROTECTED]

Visit our website : http://www.approach.be/

Disclaimer_____________________________________________________________
1.This message is intended for the use of the addressee only and may
contain information that is privileged and confidential.
2.If you are not the intended recipient, you are notified that any
dissemination of this Communication is strictly prohibited.
3.If you have received this communication in error, please notify us
immediately by return of this e-mail.
4.E-mail quotations and proposals are for information only, and
are subject to confirmation by the Signature of the appropriate
contractual documentation by the authorized persons of both parties.

Reply via email to