You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bernd Wiswedel <Be...@uni-konstanz.de> on 2009/08/16 14:24:08 UTC

ClientOutFaultObserver in ClientImpl not initialized

The field 
protected ClientOutFaultObserver outFaultObserver; 
in class org.apache.cxf.endpoint.ClientImpl is not initialized when using the 
ClientImpl(URL wsdlUrl) constructor (e.g. when used via the 
DynamicClientFactory). This is different when using the code generator 
wsdl2java.

My program generates the client at runtime and uses ClientCallbacks to consume 
web service results. The ClientCallback never gets called on an exception such 
as "org.apache.cxf.interceptor.Fault: Could not send Message." (I pulled my 
network cable.). When using a statically generated Client (wsdl2java) things 
work fine .. which is due to the ClientOutFaultObserver, which gets set in one 
of the constructors in ClientImpl but not the other.

Was there any design reason behind this? How can I "fix" it?

Thanks
 Bernd



Re: ClientOutFaultObserver in ClientImpl not initialized

Posted by Bernd Wiswedel <Be...@gmail.com>.
I have opened the bug and attached a patch to it:
https://issues.apache.org/jira/browse/CXF-2409

As current workaround I created a custom utility class in the exact same 
package, which then sets the field right after the ClientImpl has been 
constructed. (Wise idea to make all fields protected!)

Thanks,
 Bernd

Am Mittwoch, 19. August 2009 20:33:06 schrieb Daniel Kulp:
> That definitely sounds like a bug.   Can you log a jira issue and possibly
> attach a patch?   Other than resorting to some reflection to set the field
> directly, I'm not sure there is a workaround.  :-(
>
>
>
> Dan
>
> On Sun August 16 2009 8:24:08 am Bernd Wiswedel wrote:
> > The field
> > protected ClientOutFaultObserver outFaultObserver;
> > in class org.apache.cxf.endpoint.ClientImpl is not initialized when using
> > the ClientImpl(URL wsdlUrl) constructor (e.g. when used via the
> > DynamicClientFactory). This is different when using the code generator
> > wsdl2java.
> >
> > My program generates the client at runtime and uses ClientCallbacks to
> > consume web service results. The ClientCallback never gets called on an
> > exception such as "org.apache.cxf.interceptor.Fault: Could not send
> > Message." (I pulled my network cable.). When using a statically generated
> > Client (wsdl2java) things work fine .. which is due to the
> > ClientOutFaultObserver, which gets set in one of the constructors in
> > ClientImpl but not the other.
> >
> > Was there any design reason behind this? How can I "fix" it?
> >
> > Thanks
> >  Bernd


Re: ClientOutFaultObserver in ClientImpl not initialized

Posted by Daniel Kulp <dk...@apache.org>.
That definitely sounds like a bug.   Can you log a jira issue and possibly 
attach a patch?   Other than resorting to some reflection to set the field 
directly, I'm not sure there is a workaround.  :-(



Dan


On Sun August 16 2009 8:24:08 am Bernd Wiswedel wrote:
> The field
> protected ClientOutFaultObserver outFaultObserver;
> in class org.apache.cxf.endpoint.ClientImpl is not initialized when using
> the ClientImpl(URL wsdlUrl) constructor (e.g. when used via the
> DynamicClientFactory). This is different when using the code generator
> wsdl2java.
>
> My program generates the client at runtime and uses ClientCallbacks to
> consume web service results. The ClientCallback never gets called on an
> exception such as "org.apache.cxf.interceptor.Fault: Could not send
> Message." (I pulled my network cable.). When using a statically generated
> Client (wsdl2java) things work fine .. which is due to the
> ClientOutFaultObserver, which gets set in one of the constructors in
> ClientImpl but not the other.
>
> Was there any design reason behind this? How can I "fix" it?
>
> Thanks
>  Bernd

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