Exception when setPrettyLogging(true) for LoggingInInterceptor (or 
LoggingOutInterceptor)
-----------------------------------------------------------------------------------------

                 Key: CXF-3590
                 URL: https://issues.apache.org/jira/browse/CXF-3590
             Project: CXF
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.4.1
            Reporter: Sergei Danilov
            Priority: Minor


to reproduce

create own logging interceptor

public class PrettyLoggingInInterceptor extends LoggingInInterceptor {

  @Override
  protected void writePayload(StringBuilder builder, CachedOutputStream cos,
      String encoding, String contentType)
      throws Exception {

    setPrettyLogging(true);

    super.writePayload(builder, cos, encoding, contentType);
  }

}


1. add PrettyLoggingInInterceptor to web service 
2. run client 
3. javax.wsdl.WSDLException: WSDLException arise because some client request 
have no content (e.g get wsdl)


workaround

public class PatchPrettyLoggingInInterceptor extends LoggingInInterceptor {

  @Override
  protected void writePayload(StringBuilder builder, CachedOutputStream cos,
      String encoding, String contentType)
      throws Exception {

    setPrettyLogging(true);

    //patch
    if (cos.size() == 0)
      setPrettyLogging(false);

    super.writePayload(builder, cos, encoding, contentType);
  }

}



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to