It would be nice if we can catch the HTTP 500 error and throw this to the 
client as a ProtocolException instead of failed silently.  I will file a JIRA 
if this sounds a reasable solution.

Cheers,
Jervis

> -----Original Message-----
> From: tirtza [mailto:[EMAIL PROTECTED]
> Sent: 2007?10?30? 18:19
> To: [email protected]
> Subject: Re: Dispatch Client + JaxB
> 
> 
> 
> I see the problem-  I was passing JAXBContext.class instead 
> of a JAXBContext
> object.
> My current problem is when using the dispatch method, if the 
> service returns
> a bad response such as a 500 instead of a SoapFaultException 
> being thrown I
> get an Unmarshalling Error since it could not create the 
> response object. 
> Is there a way around this?
> 
> 
> 
> tirtza wrote:
> > 
> > I created a dispatch client since I am invoking a service 
> that returns the
> > soap message as rpc/encoded.
> > I am using PAYLOAD mode since I want a JaxB object returned.
> > My client generates this exception
> > 
> > org.apache.cxf.interceptor.Fault: Exception occurred while 
> marshalling
> > Dispatch object to stream
> >     at
> > 
> org.apache.cxf.jaxws.interceptors.DispatchOutDatabindingInterc
> eptor.handleMessage(DispatchOutDatabindingInterceptor.java:116)
> >     at
> > 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIn
terceptorChain.java:207)
> >     at 
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:172)
> >     at 
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:121)
> >     at
> > 
> net.idt.svp.Nomad.client.BalanceEnquiryClient.main(BalanceEnqu
iryClient.java:38)
> > Caused by: java.lang.ClassCastException:
> > net.idt.svp.Nomad.client.communication.BalanceEnquiryRqstInfo
> >     at
> > 
> org.apache.cxf.databinding.source.NodeDataWriter.write(NodeDat
aWriter.java:52)
> >     at
> > 
> org.apache.cxf.databinding.source.NodeDataWriter.write(NodeDat
aWriter.java:43)
> >     at
> > 
> org.apache.cxf.jaxws.interceptors.DispatchOutDatabindingInterc
> eptor.handleMessage(DispatchOutDatabindingInterceptor.java:112)
> >     ... 4 more
> > Exception in thread "main" 
> javax.xml.ws.soap.SOAPFaultException: Exception
> > occurred while marshalling Dispatch object to stream
> >     at 
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:183)
> >     at 
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:121)
> >     at
> > 
> net.idt.svp.Nomad.client.BalanceEnquiryClient.main(BalanceEnqu
iryClient.java:38)
> > 
> > What am I doing wrong?
> > Here is my client code.
> > 
> > URL wsdlURL =  new
> > 
> URL("http://someurl:20903/webservices/services/BalanceEnquiry?wsdl";);
> > QName qName=new QName("urn:BalanceEnquiry", 
> "BalanceEnquiryService");
> > QName portName=new QName("urn:BalanceEnquiry", "BalanceEnquiry");
> > BalanceEnquiryService ss = new 
> BalanceEnquiryService(wsdlURL, qName);
> > 
> > Dispatch dispatch = ss.createDispatch(portName, JAXBContext.class ,
> > Service.Mode.PAYLOAD);
> > BalanceEnquiryRspsInfo resp= (BalanceEnquiryRspsInfo)
> > dispatch.invoke(getRequest());
> > 
> > My request and response object were generated using wsdl2java
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Dispatch-Client-%2B-JaxB-tf4717372.html#
a13485745
Sent from the cxf-user mailing list archive at Nabble.com.

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to