@Bean
 public LoggingInInterceptor getLogInInterceptor() {
   LoggingInInterceptor logIn = new LoggingInInterceptor();
   logIn.setPrettyLogging(true);
   logIn.setShowBinaryContent(true);
   logIn.setShowMultipartContent(true);
   return logIn;
 }
  public List<Interceptor<? extends Message>> getLogInInterceptors() {
    List<Interceptor<? extends Message>> inInterceptors =
        new ArrayList<Interceptor<? extends Message>>();
    if (config.isCxfDebug()) {
      LoggingInInterceptor loggingInInterceptor = new LoggingInInterceptor();
      loggingInInterceptor.setPrettyLogging(true);

      inInterceptors.add(loggingInInterceptor);
    }

    return inInterceptors;
  }
  @Bean
  CustomerRealmWebService customerRealmWebService(
      Environment environment,
      AccessTokens accessTokens,
      CustomerRealmProperties customerRealmProperties) {
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setAddress(customerRealmProperties.getServiceUrl());
    factory.setServiceClass(CustomerRealmWebService.class);
    OAuth2TokenInterceptor oAuth2TokenInterceptor =
        new OAuth2TokenInterceptor(accessTokens, SERVICE_ID);
    factory.getOutInterceptors().add(oAuth2TokenInterceptor);

    if (environment.containsProperty("debug") || environment.containsProperty("trace")) {
      LoggingInInterceptor loggingInInterceptor = new LoggingInInterceptor();
      loggingInInterceptor.setPrettyLogging(true);
      LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor();
      loggingOutInterceptor.setPrettyLogging(true);
      factory.getInInterceptors().add(loggingInInterceptor);
      factory.getOutInterceptors().add(loggingOutInterceptor);
    }

    return (CustomerRealmWebService) factory.create();
  }
示例#4
0
  @Override
  protected void initializeProvider(InterceptorProvider provider, Bus bus) {
    if (limit == DEFAULT_LIMIT && inLocation == null && outLocation == null && !prettyLogging) {
      provider.getInInterceptors().add(IN);
      provider.getInFaultInterceptors().add(IN);
      provider.getOutInterceptors().add(OUT);
      provider.getOutFaultInterceptors().add(OUT);
    } else {
      LoggingInInterceptor in = new LoggingInInterceptor(limit);
      in.setOutputLocation(inLocation);
      in.setPrettyLogging(prettyLogging);
      in.setShowBinaryContent(showBinary);
      LoggingOutInterceptor out = new LoggingOutInterceptor(limit);
      out.setOutputLocation(outLocation);
      out.setPrettyLogging(prettyLogging);
      out.setShowBinaryContent(showBinary);

      provider.getInInterceptors().add(in);
      provider.getInFaultInterceptors().add(in);
      provider.getOutInterceptors().add(out);
      provider.getOutFaultInterceptors().add(out);
    }
  }