You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sean O'Callaghan (JIRA)" <ji...@apache.org> on 2008/12/02 17:56:44 UTC
[jira] Commented: (CXF-1828) inFaultInterceptors doesn't work as
expected
[ https://issues.apache.org/jira/browse/CXF-1828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652424#action_12652424 ]
Sean O'Callaghan commented on CXF-1828:
---------------------------------------
Hi Dmitry,
I've just begun looking at this and can reproduce the issue with the configuration_interceptor as is(without your modifications).
(Note, I'm working off trunk 2.2-SNAPSHOT).
I then modified the client so that instead of having the WSDL passed into it, it was read in as a resource:
wsdlURL = Client.class.getResource("hello_world.wsdl");
You will need to modify the pom.xml in order for the Client.class to be able to access the wsdl;
<tasks>
<copy file="${basedir}/src/demo/stream/client/client.xml" todir="${basedir}/target/classes/demo/stream/client"/>
<copy file="${basedir}/src/demo/stream/server/server.xml" todir="${basedir}/target/classes/demo/stream/server"/>
<copy file="${basedir}/wsdl/hello_world.wsdl" todir="${basedir}/target/classes/demo/stream/client"/> add this line
</tasks>
</configuration>
I haven't figured out why the difference in behaviour but am curious as to what behaviour you see after such changes?
Seán.
> inFaultInterceptors doesn't work as expected
> --------------------------------------------
>
> Key: CXF-1828
> URL: https://issues.apache.org/jira/browse/CXF-1828
> Project: CXF
> Issue Type: Bug
> Components: Bus, Samples
> Affects Versions: 2.1.1, 2.1.2, 2.1.3
> Environment: java 1.6
> Reporter: Dmitry
> Assignee: Sean O'Callaghan
> Fix For: 2.1.4
>
> Attachments: Client.java, client.xml, server.xml
>
>
> I'm trying to zip FAULT response from server.
> Server properly zip response , so server's [outFaultInterceptors] work fine
> But, It looks like client couldn't properly process it in [inFaultInterceptors]
> Step to reproduce:
> 1. Upade sample code from standart distributive
> apache-cxf-2.1.2/samples/configuration_interceptor
> client.xml:
> <cxf:bus>
> <cxf:inInterceptors>
> </cxf:inInterceptors>
> <cxf:inFaultInterceptors>
> <ref bean="GZIPStream"/>
> </cxf:inFaultInterceptors>
> <!--cxf:outInterceptors>
> <ref bean="GZIPStream"/>
> </cxf:outInterceptors>
> <cxf:outFaultInterceptors>
> <ref bean="GZIPStream"/>
> </cxf:outFaultInterceptors-->
> </cxf:bus>
> server:xml:
> <cxf:bus>
> <!--cxf:inInterceptors>
> <ref bean="GZIPStream"/>
> </cxf:inInterceptors>
> <cxf:inFaultInterceptors>
> <ref bean="GZIPStream"/>
> </cxf:inFaultInterceptors-->
> <cxf:outInterceptors>
> <!--ref bean="GZIPStream"/-->
> </cxf:outInterceptors>
> <cxf:outFaultInterceptors>
> <ref bean="GZIPStream"/>
> </cxf:outFaultInterceptors>
> </cxf:bus>
> Client.java:
> add next code and uncomment //import lines:
> import org.apache.hello_world_soap_http.PingMeFault;
> import org.apache.hello_world_soap_http.types.FaultDetail;
> ...
> try {
> System.out.println("Invoking pingMe, expecting exception...");
> port.pingMe();
> } catch (PingMeFault ex) {
> System.out.println("Expected exception: PingMeFault has occurred: " + ex.getMessage());
> FaultDetail detail = ex.getFaultInfo();
> System.out.println("FaultDetail major:" + detail.getMajor());
> System.out.println("FaultDetail minor:" + detail.getMinor());
> }
> System.exit(0);
> }
> Result:
> [java] Invoking pingMe, expecting exception...
> [java] Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could not create XMLStreamReader (input was of encoding UTF-8).
> [java] at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> [java] at $Proxy41.pingMe(Unknown Source)
> [java] at demo.stream.client.Client.main(Client.java:67)
> [java] Caused by: org.apache.cxf.interceptor.Fault: Could not create XMLStreamReader (input was of encoding UTF-8).
> [java] at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:83)
> [java] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> [java] at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> [java] at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> [java] at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> [java] at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> [java] at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> [java] at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> [java] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> [java] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> [java] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> [java] at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> [java] at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> [java] ... 2 more
> [java] Caused by: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 start byte 0x8b (at char #2, byte #-1)
> [java] at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:548)
> [java] at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:604)
> [java] at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:629)
> [java] at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:324)
> [java] at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:81)
> [java] ... 14 more
> [java] Caused by: java.io.CharConversionException: Invalid UTF-8 start byte 0x8b (at char #2, byte #-1)
> [java] at com.ctc.wstx.io.UTF8Reader.reportInvalidInitial(UTF8Reader.java:302)
> [java] at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:188)
> [java] at com.ctc.wstx.io.ReaderBootstrapper.initialLoad(ReaderBootstrapper.java:245)
> [java] at com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:132)
> [java] at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:543)
> [java] ... 18 more
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.