You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by landry soules <la...@gmail.com> on 2007/07/23 11:07:24 UTC
Fault logging
Hello,
I developped a web service (server) and need to log every transaction in
database. So i made a handler, inspired by
org.apache.axis.handlers.LogHandler.
I deployed it with deploy.wsdd, and it works well, for standard
transactions. However, everytime my webservice answers with an error, the
message isn't logged.
For example :
When mywebservice returns the message below, it isn't logged by my handler,
nor by Axis' one.
<soapenv:Envelope>
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>
java.rmi.RemoteException: Authentification non valide
</faultstring>
<detail>
<ns1:hostname>wmar6034</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Can somebody please help me ?
Re: Fault logging
Posted by landry soules <la...@gmail.com>.
Thanks a lot, it works !
Just a precision for people who have the same problem : when you implement
onFault, you can get the exception with AxisFault, for example :
msgContext.getResponseMessage().getSOAPBody().getFault().getFaultString()
2007/7/23, cara <pi...@gmail.com>:
>
> I had the same problem. My ServiceLogHandler extends the axis LogHandler.
> I can pull normal messages from the MessageContext by implementing the
> invoke method. To catch and log exceptions in the handler chain, I had to
> implement public void onFault(msgContext).
>
> On 7/23/07, landry soules <landry.p.soules@gmail.com > wrote:
> >
> > Hello,
> >
> > I developped a web service (server) and need to log every transaction in
> > database. So i made a handler, inspired by
> > org.apache.axis.handlers.LogHandler.
> > I deployed it with deploy.wsdd, and it works well, for standard
> > transactions. However, everytime my webservice answers with an error, the
> > message isn't logged.
> > For example :
> >
> > When mywebservice returns the message below, it isn't logged by my
> > handler, nor by Axis' one.
> >
> > <soapenv:Envelope>
> > <soapenv:Body>
> > <soapenv:Fault>
> > <faultcode>soapenv:Server.userException</faultcode>
> > <faultstring>
> > java.rmi.RemoteException: Authentification non valide
> > </faultstring>
> > <detail>
> > <ns1:hostname>wmar6034</ns1:hostname>
> > </detail>
> > </soapenv:Fault>
> > </soapenv:Body>
> > </soapenv:Envelope>
> >
> >
> > Can somebody please help me ?
> >
>
>
Re: Fault logging
Posted by cara <pi...@gmail.com>.
I had the same problem. My ServiceLogHandler extends the axis LogHandler. I
can pull normal messages from the MessageContext by implementing the invoke
method. To catch and log exceptions in the handler chain, I had to implement
public void onFault(msgContext).
On 7/23/07, landry soules <la...@gmail.com> wrote:
>
> Hello,
>
> I developped a web service (server) and need to log every transaction in
> database. So i made a handler, inspired by
> org.apache.axis.handlers.LogHandler.
> I deployed it with deploy.wsdd, and it works well, for standard
> transactions. However, everytime my webservice answers with an error, the
> message isn't logged.
> For example :
>
> When mywebservice returns the message below, it isn't logged by my
> handler, nor by Axis' one.
>
> <soapenv:Envelope>
> <soapenv:Body>
> <soapenv:Fault>
> <faultcode>soapenv:Server.userException</faultcode>
> <faultstring>
> java.rmi.RemoteException: Authentification non valide
> </faultstring>
> <detail>
> <ns1:hostname>wmar6034</ns1:hostname>
> </detail>
> </soapenv:Fault>
> </soapenv:Body>
> </soapenv:Envelope>
>
>
> Can somebody please help me ?
>