0 Replies Latest reply on Dec 12, 2013 7:37 AM by aleeuwen

    Verbose web services error logging

    aleeuwen

      Hello,

       

      I've developed some webservices on JBoss 7.0.2.Final using the standard stack. Up until now I didn't have any exceptions / faults defined other than really unexpected exceptions such as the database not being available or similar. Stuff that is simply unforeseen. Now I've added an 'authentication' method that either returns an Authentication kind of object with roles etc or it throws an exception in case of failure. Mimicking for example spring-security a little bit because there are multiple ways in which the authentication might fail, signalling different things. My approach is code-first, so I have this kind of code:

       

      @Local
      @WebService(targetNamespace = "http://webservice.manyware.pvda.nl/", wsdlLocation = ManywareWs.WSDL_LOCATION)
      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
      public interface ManywareWs {
         // ..
         
          @WebMethod(operationName = "authenticate")
          AuthenticationVo authenticate(
                  @XmlElement(required=true) @WebParam(name = "email") String email,
                  @XmlElement(required=true) @WebParam(name = "password") String password)
                  throws MemberNotFoundException, BadCredentialsException, MultipleMembersFoundException, NoWebAccountFoundException;
      }
      

       

      Which I can call and get a fault response in the case of an error:

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Body>
            <soap:Fault>
               <faultcode>soap:Server</faultcode>
               <faultstring>Unable to find member for the e-mail address: some@thing.nl</faultstring>
               <detail>
                  <ns1:MemberNotFoundException xmlns:ns1="http://webservice.manyware.pvda.nl/"/>
               </detail>
            </soap:Fault>
         </soap:Body>
      </soap:Envelope>
      

       

      All okay I think, however the logging on the server is kind of intense. First I get a log from org.jboss.as.webservices.invocation.InvocationHandlerEJB3 on ERROR level with a full stacktrace, after then the same stacktrace yet again via the org.apache.cxf.phase.PhaseInterceptorChain, this time as a WARNING.

       

      Now sure I can probably suppress that in my logging configuration, however I'd rather not exclude ERRORS on this level, suppressing the WARNING might be ok-ish.

       

      Anyway, my question is: did I configure something incorrectly? I was not expecting checked exceptions (which they are) in the signature to be logged at this level? I would guess they are to be expected and handled at the client side where the logging is handled if implemented properly I guess.

       

      --

      Auke