Hi, there is no such a thing as fes:PropertyName, I believe it's called fes:ValueReference instead. That's the first issue that I see, there might be others, in general, check the schemas and use the appropriate element names and namespaces for the WFS version at hand.
GeoServer might be able to validate and tell you where the errors are if you post to a URL where strict=true was added in the query string, e.g.: http://server:port/geoserver/wfs?strict=true Cheers Andrea On Mon, Dec 17, 2018 at 1:39 AM Miguel A. Manso UPM <[email protected]> wrote: > Hello, > > I need to relate two TypeNames using filtering and intersection. > > I have build this WFS request that works fine with WFS 1.1.0 but do not > work with WFS 2.0.0 > > Can any one help me, please? > > Miguel A > > WFS 1.1.0 > > <wfs:GetFeature service="WFS" version="1.1.0" > outputFormat="text/xml; subtype=gml/3.1.1"> > <wfs:Query typeName="c:roads"> > <ogc:Filter> > <ogc:And> > <ogc:Intersects> > <ogc:PropertyName>geom</ogc:PropertyName> > <ogc:Function name="querySingle"> > <ogc:Literal>c:municipalities</ogc:Literal> > <ogc:Literal>geom</ogc:Literal> > <ogc:Literal>nameunit like '%San > Lorenzo de Calatrava%'</ogc:Literal> > </ogc:Function> > </ogc:Intersects> > <ogc:PropertyIsLike escapeChar="\" > singleChar="_" wildCard="%"> > <ogc:PropertyName>c:name</ogc:PropertyName> > <ogc:Literal>%CR-5042%</ogc:Literal> > </ogc:PropertyIsLike> > </ogc:And> > </ogc:Filter> > </wfs:Query> > </wfs:GetFeature> > > WFS 2.0 > > <wfs:GetFeature service="WFS" version="2.0.0" > xmlns:wfs="http://www.opengis.net/wfs/2.0" > xmlns:fes="http://www.opengis.net/fes/2.0" > xmlns:sf="http://www.openplans.org/spearfish" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:c="http://www.upm.es" xmlns:myns=" > http://www.someserver.com/myns" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xsi:schemaLocation="http://www.opengis.net/wfs/2.0 > http://schemas.opengis.net/wfs/2.0/wfs.xsd"> > <wfs:Query typeNames="c:roads"> > <fes:Filter> > <fes:And> > <fes:Intersects> > <fes:PropertyName>geom</fes:PropertyName> > <fes:Function name="querySingle"> > <fes:Literal>c:municipalities</fes:Literal> > <fes:Literal>geom</fes:Literal> > <fes:Literal>nameunit like '%San Lorenzo de > Calatrava%'</fes:Literal> > </fes:Function> > </fes:Intersects> > <fes:PropertyIsLike escapeChar="\" singleChar="_" > wildCard="%"> > <fes:PropertyName>c:name</fes:PropertyName> > <fes:Literal>CR-5042</fes:Literal> > </fes:PropertyIsLike> > </fes:And> > </fes:Filter> > </wfs:Query> > </wfs:GetFeature> > > > Error: > > java.lang.NullPointerException > at > org.geotools.filter.LikeFilterImpl.toString(LikeFilterImpl.java:418) > at > org.geotools.filter.LogicFilterImpl.toString(LogicFilterImpl.java:157) > at java.lang.String.valueOf(Unknown Source) > at java.lang.StringBuffer.append(Unknown Source) > at > > net.opengis.fes20.impl.AbstractAdhocQueryExpressionTypeImpl.toString(AbstractAdhocQueryExpressionTypeImpl.java:332) > at > net.opengis.wfs20.impl.QueryTypeImpl.toString(QueryTypeImpl.java:334) > at java.lang.String.valueOf(Unknown Source) > at java.lang.StringBuilder.append(Unknown Source) > at > > org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$BasicFeatureMapEntry.toString(EStructuralFeatureImpl.java:3272) > at java.lang.String.valueOf(Unknown Source) > at java.lang.StringBuilder.append(Unknown Source) > at org.geoserver.ows.util.EMFLogger.log(EMFLogger.java:74) > at org.geoserver.ows.util.EMFLogger.log(EMFLogger.java:55) > at > > org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:51) > at > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) > at > > org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) > at com.sun.proxy.$Proxy94.getFeature(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:857) > at > org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:268) > at > > org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:174) > at > > org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50) > at > > org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) > at > > org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) > at > > org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) > at > > org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) > at > > org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) > at > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) > at > > org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at > > org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75) > at > org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71) > at > > org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71) > at > > org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at > > org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at > > org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316) > at > > org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) > at > > org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126) > at > > org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90) > at > > org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) > at > > org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) > at > > org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) > at > > org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) > at > > org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) > at > > org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) > at > > org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) > at > > org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) > at > > org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54) > at > > org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) > at > > org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) > at > > org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158) > at > > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) > at > > org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) > at > > org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) > at > > org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:84) > at > > org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) > at > > org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69) > at > > org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91) > at > > org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53) > at > > org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73) > at > > org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92) > at > > org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) > at > > org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213) > at > > org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176) > at > > org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:152) > at > > org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) > at > > org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:88) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at > > org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:89) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at > > org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at > org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at > > org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:256) > at > > org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:219) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at > > org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) > at > > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) > at > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) > at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) > at > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) > at > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) > at > > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) > at > > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) > at > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) > at > > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) > at > > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) > at > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) > at > > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215) > at > > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110) > at > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) > at org.eclipse.jetty.server.Server.handle(Server.java:499) > at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) > at > org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) > at > org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) > at > > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) > at > > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) > at java.lang.Thread.run(Unknown Source) > > > > > --- > El software de antivirus Avast ha analizado este correo electrónico en > busca de virus. > https://www.avast.com/antivirus > > > > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > [email protected] > https://lists.sourceforge.net/lists/listinfo/geoserver-users > -- Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- *Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.*
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
