1 Reply Latest reply on Jan 31, 2005 10:05 AM by mpitanga

    Monitoring Web Services

    mpitanga

      Hi,

      I´m have installed a simple-ws4ee HelloWorld example and now work´s fine using the Axis 1.2RC2.

      Now, i´d like monitoring this service and i´ve implemented a J2EE Filter that displayed the request and response of web applications at Jboss services Tomcat...

      When i execute a client program for access this web service ( simple-ws4ee ) my filter display request action but the soapaction content is null and i´not see soap-message...

      This is a problem or i using the wrong mechanism for monitoring this web service...


      Request address : 192.168.2.41
      RemoteHost : 192.168.2.41
      RemotePort : 1696
      sessionId : null
      method : POST
      url : http://popshopdes:8080/simple-ws4ee/exactpath/jse
      RemoteUser : null
      AuthType : null
      ContentType : text/xml; charset=utf-8
      RequestURI : /simple-ws4ee/exactpath/jse
      QueryString : null
      Protocol : HTTP/1.0
      PathInfo : null
      HeaderNames : content-type Content : text/xml; charset=utf-8
      HeaderNames : accept Content : application/soap+xml, application/dime, multi
      part/related, text/*
      HeaderNames : user-agent Content : Axis/1.2RC2
      HeaderNames : host Content : popshopdes:8080
      HeaderNames : cache-control Content : no-cache
      HeaderNames : pragma Content : no-cache
      HeaderNames : soapaction Content : ""
      HeaderNames : content-length Content : 439
      Request
      http


       public void doFilter(ServletRequest request,
       ServletResponse response,
       FilterChain chain) throws IOException, ServletException {
      
       if (filterConfig == null) return;
       Date inicio = new Date();
      
       //executa antes da requisição chegar ao servlet
       String type = request.getContentType();
      
       if (type == null || type.equals("") || type.contains("x-www-form") || type.contains("text") || type.contains("xml")) {
       type = "";
       }
       String res = "";
       String req = "";
      
       req = (String)((HttpServletRequest)request).getScheme();
      
       if (!type.equals("")) {
       res = "ContentType="+type;
       chain.doFilter(request, response);
       }
       else {
       if (response instanceof HttpServletResponse){
       CharResponseWrapper responsewrapper
       = new CharResponseWrapper((HttpServletResponse)response);
       chain.doFilter(request, responsewrapper);
       response.setContentType(type);
       HttpServletResponse out = (HttpServletResponse)response;
       res = responsewrapper.toString();
       out.getOutputStream().print(res);
       } else {
       chain.doFilter(request, response);
       }
       }
       //executa apos o servlet gerar o response
      
       Date fim = new Date();