cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Diephouse <...@envoisolutions.com>
Subject Re: [Fwd: soap fault]
Date Mon, 18 Sep 2006 09:25:23 GMT
Hi James,

James Mao wrote:

> Hi Dan,
>
> We just tried the soap fault in hello_world demo, but no luck, seems 
> still have some problems.
>
That is because the client side fault handing hasn't been fully tied 
together yet. Only the Server side.

> And i'm wondering if you can provider some high level design docs (How 
> easy to extend the fault?)

Well a service of a interceptor chain throws a SoapFault/Fault. The 
Endpoint's FaultInterceptor is then invoked by the 
PhaseInterceptorChain. This fault interceptor starts off a new chain 
which invokes all the out fault interceptors. In the JAX-WS case, there 
are two important interceptors. First, the WebFaultInterceptor. This 
takes an exception a JAX-WS service throws and serializes it to the 
Fault detail element. The second, the Soap11OutFaultInterceptor 
serializes the fault to the wire.

> The reason is for the other commiters they can start working on some 
> other fault (like xmlfault for xml binding)
> So, in this way we have the same mechanism to process the fault.

Take a look at how the soap binding does it and step through the code. 
Its pretty easy to figure out.

>
> I remember that you said currently the soap fault will support both 
> soap1.1 and soap1.2, if we can have a system test or demo to show 
> both, that'll be great.
>
See the SoapFaultTest to get an idea of what is currently working.

> Thanks in advance.
> James.
>
> ------------------------------------------------------------------------
>
> Subject:
> soap fault
> From:
> Freeman Fang <freeman.fang@iona.com>
> Date:
> Mon, 18 Sep 2006 11:08:36 +0800
> To:
> Mao James <james.mao@iona.com>
>
> To:
> Mao James <james.mao@iona.com>
>
>
>
> [java] Invoking pingMe, expecting exception...
>     [java] Exception in thread "main" java.lang.RuntimeException: 
> org.apache.cxf.interceptor.Fault: Marshalling Error
>     [java]     at 
> org.apache.cxf.endpoint.ClientImpl.waitResponse(ClientImpl.java:174)
>     [java]     at 
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:152)
>     [java]     at 
> org.apache.cxf.jaxws.EndpointInvocationHandler.invokeSync(EndpointInvocationHandler.java:112)

>
>     [java]     at 
> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:103)

>
>     [java]     at $Proxy33.pingMe(Unknown Source)
>     [java]     at demo.hw.client.Client.main(Client.java:85)
>     [java] Caused by: org.apache.cxf.interceptor.Fault: Marshalling Error
>     [java]     at 
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:351) 
>
>     [java]     at 
> org.apache.cxf.jaxb.io.MessageDataReader.read(MessageDataReader.java:72)
>     [java]     at 
> org.apache.cxf.jaxb.io.MessageDataReader.read(MessageDataReader.java:48)
>     [java]     at 
> org.apache.cxf.jaxb.io.MessageDataReader.read(MessageDataReader.java:44)
>     [java]     at 
> org.apache.cxf.jaxb.io.MessageDataReader.read(MessageDataReader.java:35)
>     [java]     at 
> org.apache.cxf.interceptor.WrappedInInterceptor.handleMessage(WrappedInInterceptor.java:89)

>
>     [java]     at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:132)

>
>     [java]     at 
> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:228)
>     [java]     at 
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:432)

>
>     [java]     at 
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.doClose(HTTPConduit.java:400)

>
>     [java]     at 
> org.apache.cxf.transport.AbstractCachedOutputStream.close(AbstractCachedOutputStream.java:77)

>
>     [java]     at 
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:210)
>     [java]     at 
> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:53)

>
>     [java]     at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:132)

>
>     [java]     at 
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:135)
>     [java]     ... 4 more
>     [java] Caused by: javax.xml.bind.UnmarshalException
>  [java]  - with linked exception:
>     [java] [javax.xml.bind.UnmarshalException: unexpected element 
> (uri:"http://schemas.xmlsoap.org/soap/envelope/", local:"Fault"). 
> Expected elements are 
> <{http://www.w3.org/2005/08/addressing/wsdl}InterfaceName>,<{http://www.w3.org/2005/08/addressing/wsdl}ServiceName>,<{http://www.w3.org/2005/08/addressing/wsdl}UsingAddressing>,<{http://apache.org/hello_world_soap_http/types}faultDetail>,<{http://apache.org/hello_world_soap_http/types}greetMe>,<{http://apache.org/hello_world_soap_http/types}greetMeOneWay>,<{http://apache.org/hello_world_soap_http/types}greetMeResponse>,<{http://apache.org/hello_world_soap_http/types}pingMe>,<{http://apache.org/hello_world_soap_http/types}pingMeResponse>,<{http://apache.org/hello_world_soap_http/types}sayHi>,<{http://apache.org/hello_world_soap_http/types}sayHiResponse>]

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:395)

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:334)

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:304)

>
>     [java]     at 
> org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:342) 
>
>     [java]     ... 18 more
>     [java] Caused by: javax.xml.bind.UnmarshalException: unexpected 
> element (uri:"http://schemas.xmlsoap.org/soap/envelope/", 
> local:"Fault"). Expected elements are 
> <{http://www.w3.org/2005/08/addressing/wsdl}InterfaceName>,<{http://www.w3.org/2005/08/addressing/wsdl}ServiceName>,<{http://www.w3.org/2005/08/addressing/wsdl}UsingAddressing>,<{http://apache.org/hello_world_soap_http/types}faultDetail>,<{http://apache.org/hello_world_soap_http/types}greetMe>,<{http://apache.org/hello_world_soap_http/types}greetMeOneWay>,<{http://apache.org/hello_world_soap_http/types}greetMeResponse>,<{http://apache.org/hello_world_soap_http/types}pingMe>,<{http://apache.org/hello_world_soap_http/types}pingMeResponse>,<{http://apache.org/hello_world_soap_http/types}sayHi>,<{http://apache.org/hello_world_soap_http/types}sayHiResponse>

>
>   [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:523)

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:199) 
>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:194) 
>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:71)

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:920)

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:366)

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:347)

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:35)

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:200)

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:134)

>
>     [java]     at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:332)

>
>     [java]     ... 20 more
>     [java] Caused by: javax.xml.bind.UnmarshalException: unexpected 
> element (uri:"http://schemas.xmlsoap.org/soap/envelope/", 
> local:"Fault"). Expected elements are 
> <{http://www.w3.org/2005/08/addressing/wsdl}InterfaceName>,<{http://www.w3.org/2005/08/addressing/wsdl}ServiceName>,<{http://www.w3.org/2005/08/addressing/wsdl}UsingAddressing>,<{http://apache.org/hello_world_soap_http/types}faultDetail>,<{http://apache.org/hello_world_soap_http/types}greetMe>,<{http://apache.org/hello_world_soap_http/types}greetMeOneWay>,<{http://apache.org/hello_world_soap_http/types}greetMeResponse>,<{http://apache.org/hello_world_soap_http/types}pingMe>,<{http://apache.org/hello_world_soap_http/types}pingMeResponse>,<{http://apache.org/hello_world_soap_http/types}sayHi>,<{http://apache.org/hello_world_soap_http/types}sayHiResponse>

>
>     [java]     ... 31 more
>     [java] Java Result: 1
>


-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com


Mime
View raw message