vendredi 8 mai 2015

Get Request Parameters from XML using WebFilter

I´m developing a Web Service, using Glassfish, using SOAP. I have several web methods, and I want to get introduce my webmethod name and his parameters to http head request.

For example:

I have this path:

context: WebServices

webMethod: makeSomething

parameters:a=2

So I create a class named ProfilingFilter:

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, javax.servlet.ServletException {

    if (request.getContentLength() != -1 && context != null) {
        ((HttpServletResponse) response).addHeader("Operation", -->PATH+PARAMETERS);
        //  ((HttpServletResponse) response).addHeader("Operation", -->makeSomething?a=2);
    }

}

It´s possible to use servlet response or servlet request to get this information?

If not, How can I do this?

Aucun commentaire:

Enregistrer un commentaire