cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Unmarshalling error while processing soap fault.
Date Wed, 11 Nov 2009 20:54:05 GMT

What does your ValidationServiceException bean look like?   Does it have 
proper getter/setters for the code attribute?


What does the schema for the service look like?  Particularly for that 
exception type.

Dan


On Wed November 11 2009 3:29:05 pm deepika vadapalli wrote:
> Hi All,
> 
> I use CXF 2.1.7.
> I have a soap message which generates valid fault. I am able to unmarshall
> faults from other services properly.
> When I call this particular  service, in my client code, I get Unmarshlling
> exception.
> When I check, the object has all the attributes, the fault messgae has
>  sent. Can you please help me out.
> Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"",
> local:"code"). Expected elements are (none)
>  at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(U
> nmarshallingContext.java:616) at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:244
> ) at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:239
> ) at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElemen
> t(Loader.java:116) at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:10
> 1) at
> com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(Struc
> tureLoader.java:245) at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement
> (UnmarshallingContext.java:452) at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(
> UnmarshallingContext.java:433) at
> com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(I
> nterningXmlVisitor.java:71) at
> com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConne
> ctor.java:137) at
>  com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:240) at
>  com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:277) at
>  com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:246) at
>  com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:123) at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unmars
> hallerImpl.java:314) at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unmarsh
> allerImpl.java:293) at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:6
> 43) at
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:5
> 33) at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:113)
>  at
> org.apache.cxf.interceptor.ClientFaultConverter.processFaultDetail(ClientFa
> ultConverter.java:131) at
> org.apache.cxf.interceptor.ClientFaultConverter.handleMessage(ClientFaultCo
> nverter.java:74) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
> n.java:236) at
> org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(Ab
> stractFaultChainInitiatorObserver.java:96) at
> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage
> (CheckFaultInterceptor.java:69) at
> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage
> (CheckFaultInterceptor.java:34) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
> n.java:236) at
>  org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:664) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespons
> eInternal(HTTPConduit.java:2131) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespons
> e(HTTPConduit.java:2014) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCon
> duit.java:1939) at
> org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputSt
> ream.java:47) at
>  org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188) at
>  org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at
>  org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:627) at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInte
> rceptor.handleMessage(MessageSenderInterceptor.java:62) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
> n.java:236) at
>  org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:478) at
>  org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:308) at
>  org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:260) at
>  org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
>  org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:127)
>  ... 56 more
> 
> here is the example response:
> 
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>Discount policy ID is required when a specific
>  Product Channel is requested for the priceComponents()
>  service.</faultstring> <detail>
>             <ns1:ValidationServiceException xmlns:ns1="
> http://faults.valueobject.application.wdw.com">
>                <additionalInfo xsi:nil="true" xmlns:ns2="
> http://packaging.valuetransferobject.application.wdw.com/" xmlns:ns3="
> http://pricing.valueobject.application.wdw.com/" xmlns:ns4="
> http://packaging.valueobject.application.wdw.com/" xmlns:ns5="
> http://chargeitems.valueobject.application.wdw.com/" xmlns:ns6="
> http://faults.valueobject.application.wdw.com/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"/>
>                <code xsi:nil="true" xmlns:ns2="
> http://packaging.valuetransferobject.application.wdw.com/" xmlns:ns3="
> http://pricing.valueobject.application.wdw.com/" xmlns:ns4="
> http://packaging.valueobject.application.wdw.com/" xmlns:ns5="
> http://chargeitems.valueobject.application.wdw.com/" xmlns:ns6="
> http://faults.valueobject.application.wdw.com/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"/>
>                <systemOfRecord xsi:nil="true" xmlns:ns2="
> http://packaging.valuetransferobject.application.wdw.com/" xmlns:ns3="
> http://pricing.valueobject.application.wdw.com/" xmlns:ns4="
> http://packaging.valueobject.application.wdw.com/" xmlns:ns5="
> http://chargeitems.valueobject.application.wdw.com/" xmlns:ns6="
> http://faults.valueobject.application.wdw.com/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"/>
>                <node xsi:nil="true" xmlns:ns2="
> http://packaging.valuetransferobject.application.wdw.com/" xmlns:ns3="
> http://pricing.valueobject.application.wdw.com/" xmlns:ns4="
> http://packaging.valueobject.application.wdw.com/" xmlns:ns5="
> http://chargeitems.valueobject.application.wdw.com/" xmlns:ns6="
> http://faults.valueobject.application.wdw.com/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"/>
>                <detailedMessage xsi:nil="true" xmlns:ns2="
> http://packaging.valuetransferobject.application.wdw.com/" xmlns:ns3="
> http://pricing.valueobject.application.wdw.com/" xmlns:ns4="
> http://packaging.valueobject.application.wdw.com/" xmlns:ns5="
> http://chargeitems.valueobject.application.wdw.com/" xmlns:ns6="
> http://faults.valueobject.application.wdw.com/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"/>
>                <severity xsi:nil="true" xmlns:ns2="
> http://packaging.valuetransferobject.application.wdw.com/" xmlns:ns3="
> http://pricing.valueobject.application.wdw.com/" xmlns:ns4="
> http://packaging.valueobject.application.wdw.com/" xmlns:ns5="
> http://chargeitems.valueobject.application.wdw.com/" xmlns:ns6="
> http://faults.valueobject.application.wdw.com/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"/>
>                <message xmlns:ns2="
> http://packaging.valuetransferobject.application.wdw.com/" xmlns:ns3="
> http://pricing.valueobject.application.wdw.com/" xmlns:ns4="
> http://packaging.valueobject.application.wdw.com/" xmlns:ns5="
> http://chargeitems.valueobject.application.wdw.com/" xmlns:ns6="
> http://faults.valueobject.application.wdw.com/">Discount policy ID is
> required when a specific Product Channel is requested for the
> priceComponents() service.</message>
>             </ns1:ValidationServiceException>
>          </detail>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> 
> 
> 
> Thnaks,
> Deepika
> 

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

Mime
View raw message