chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jorge.MARTIN-CUE...@ext.ec.europa.eu>
Subject RE: CallContext.getCmisVersion() is null for SOAP binding
Date Fri, 11 Jul 2014 10:01:54 GMT
Hello Florian,

thanks for your answer,

> WSServlet does not register new servlets. It routes all requests through one servlet.
Internally it dispatches the requests to right implementation based on the URL pattern.
Yes, you are right.
The code that is registering servlets is in com.sun.xml.ws.transport.http.servlet.WSServletContextListener

private void registerWSServlet(List<ServletAdapter> adapters, ServletContext context)
{
        if ( !ServletUtil.isServlet30Based())
            return;
        Set<String> unregisteredUrlPatterns = new HashSet<String>();
        try {
            Collection<? extends ServletRegistration> registrations = context.getServletRegistrations().values();
            for (ServletAdapter adapter : adapters) {
                if (!existsServletForUrlPattern(adapter.urlPattern, registrations)) {
                    unregisteredUrlPatterns.add(adapter.urlPattern);
                }
            }
            if (!unregisteredUrlPatterns.isEmpty()) {
                //register WSServlet Dynamically
                ServletRegistration.Dynamic registration = context.addServlet("Dynamic JAXWS
Servlet", WSServlet.class);
                registration.addMapping(unregisteredUrlPatterns.toArray(new String[unregisteredUrlPatterns.size()]));
                registration.setAsyncSupported(true);

            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

> The issue must be somewhere in your setup. Do you have your own CallContext implementation
or your own CallContext wrapper class?
No, we don't.

If I start the server in debug mode with a breakpoint in the method CmisWebServicesServlet.service()the
execution only stops when I go with the browser to 
http://localhost:8080/repo/services

if I connect with workbench, it uses http://localhost:8080/repo/services/RepositoryService
and execution is not going throw CmisWebServicesServlet.service().

Regards.



Jorge MARTIN CUERVO

European Commission
DG TRADE
Unit A4
CHAR 02/077
B-1049 Brussels/Belgium
+32 2 298 86 27
jorge.martin-cuervo@ext.ec.europa.eu


-----Original Message-----
From: Florian Müller [mailto:fmui@apache.org] 
Sent: Friday, July 11, 2014 11:16 AM
To: MARTIN CUERVO Jorge (TRADE-EXT); dev
Subject: Re: CallContext.getCmisVersion() is null for SOAP binding

Hi Jorge,

WSServlet does not register new servlets. It routes all requests through one
servlet. Internally it dispatches the requests to right implementation based on
the URL pattern.

To make sure that there is no bug in the OpenCMIS code, I've added an extra
check to the createContext() method and to the CallContextImpl class to see if
the cmis version is always set. I ran the TCK and in no case the cmis version
was null.

The issue must be somewhere in your setup. Do you have your own CallContext
implementation or your own CallContext wrapper class?

- Florian

> Hello everybody,
> 
> We are upgrading our system to CMIS 1.1, but we have still service consumers
> that uses CMIS 1.0.
> I need to know the version of the client binding, and checking the code, the 4
> servlets declared in web.xml has the version as a parameter.
> 
> The ATOM servlet is getting the parameter properly and saving in the request
> scope, but the SOAP servlet that extends WSServlet class is not working like
> it should be.
> Overwriting the service() method is not enough because the implementation of
> WSServlet is reading the file sun-jaxws.xml and registering on-the-fly new
> servlets with more concrete URL patterns.
> 
> For example:
> 
> Class
> 
> URL pattern
> 
> 
> 
> CmisWebServicesServlet
> 
> /services/*
> 
> 
> 
> Dynamic from WSServlet
> 
> /services/RepositoryService
> 
> 
> 
> 
> The code of the class CmisWebServicesServlet.service() [...]
>  request.setAttribute(CMIS_VERSION, cmisVersion); [...]
> Is never executed and when the AbstractService.createContext() never reads the
> version.
> [...] CmisVersion cmisVersion = (CmisVersion)
> request.getAttribute(CmisWebServicesServlet.CMIS_VERSION); [...]
> 
> I thought to create a customized listener to replace
> com.sun.xml.ws.transport.http.servlet.WSServletContextListener,
> but this class is final.
> 
> any other suggestion?
> 
> Regards.
> 
> Jorge MARTIN CUERVO
> [cid:image001.gif@01CCF6D0.4613B970]
> European Commission
> DG TRADE
> Unit A4
> CHAR 02/077
> B-1049 Brussels/Belgium
> +32 2 298 86 27
> jorge.martin-cuervo@ext.ec.europa.eu<mailto:jorge.martin-cuervo@ext.ec.europa.eu>
>
Mime
View raw message