Hello,
I wonder how to throw Faults inside a WebService
correctly.
Below there is a snippet from my wsdl and belo the generated Java code
(where
I would have expected a @WebFault-annotation or is that wrong?).
When I do
throw new StandardFault("test-message", msg, exc);
in the webservice implementation, this gets logged as
DefaultFaultHandler - Fault occurred! : de.ppimedia.admanws.StandardFault:
test-message
(which is fine for me), but the client does not get a StandartFault (which
is what I
would expect), but the XFireRuntimeException appended at the end. Is that
intended?
I use Tomcat 5.5 and xfire 1.2.4. Any help appreciated.
Olli
----------------------------------------------------------
----------- my wsdl
----------------------------------------------------------
<wsdl:portType name="GraphicService">
<wsdl:operation name="getVersionInfo">
<wsdl:input message="tns:VersionInfoQueryMessage"/>
<wsdl:output message="tns:VersionInfoResponseMessage"/>
<wsdl:fault name="StandardFault" message="tns:StandardFault"/>
</wsdl:operation>
...
<wsdl:portType/>
...
<wsdl:binding name="GraphicServiceHttpBinding" type="tns:GraphicService">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getVersionInfo">
<wsdlsoap:operation soapAction="get-version-info"/>
<wsdl:input><wsdlsoap:body use="literal"/></wsdl:input>
<wsdl:output><wsdlsoap:body use="literal"/></wsdl:output>
<wsdl:fault name="StandardFault">
<wsdlsoap:body use="literal"/>
</wsdl:fault>
</wsdl:operation>
...
<wsdl:binding/>
---------------------------------------------------------------------
----------- generated client code
---------------------------------------------------------------------
@WebMethod(operationName = "getVersionInfo", action =
"get-version-info")
@WebResult(name = "VersionInfo", targetNamespace =
"http://www.ppimedia.de/admanws/ext")
public de.ppimedia.admanws.ext.VersionInfo getVersionInfo(
@WebParam(name = "VersionInfo", targetNamespace =
"http://www.ppimedia.de/admanws/ext")
de.ppimedia.admanws.ext.VersionInfo VersionInfo)
throws StandardFault;
----------------------------------------------------------------------------
---
---------------- client-side stacktrace:
----------------------------------------------------------------------------
---
Could not invoke service.. Nested exception is
org.codehaus.xfire.fault.XFireFault: test-message
org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested
exception is org.codehaus.xfire.fault.XFireFault: test-message
org.codehaus.xfire.fault.XFireFault: test-message
at
org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerial
izer.java:31)
at
org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer
.java:28)
at
org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeaders
Handler.java:111)
at
org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler
.java:67)
at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Client.onReceive(Client.java:382)
at
org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java
:139)
at
org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at
org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at
org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy13.getVersionInfo(Unknown Source)
--
Oliver Matz
Development
ppi Media GmbH
Deliusstrasse 10
24114 Kiel, Germany
Geschäftsführer: Norbert Ohl, Martin Ruhle
Amtsgericht Hamburg, HRB 84308
phone +49 (0) 431-53 53 -422
fax +49 (0) 431-53 53 -222
www.ppimedia.de
Explore your printnet!
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email