Xml query help

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Xml query help

Stephen Crawford
All,

I have a Geoserver request that works via the url, and looks like this:

http://web1.cei.psu.edu:8080/geoserver/wfs?request=GetFeature&typeName=cei:s
sa_48&PropertyName=areasymbol,areaname,the_geom&Filter=<Filter><Or><Property
IsEqualTo><PropertyName>areasymbol</PropertyName><Literal>CA011</Literal></P
ropertyIsEqualTo></Or></Filter>        

This is to get a few attributes for one feature, which has areasymbol=CA011.
My problem is that I would like to do this for many (300?) features, but it
seems to break at about 50 features....I guess the url string is too long?

So I tried doing the same request via xml, which looks like this (again, for
one feature):

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2">
  <Query typeName="cei:ssa_48">
    <PropertyName>areasymbol</PropertyName>
    <PropertyName>areaname</PropertyName>
    <PropertyName>the_geom</PropertyName>
    <Filter>
      <Or>
        <PropertyIsEqualTo>
          <PropertyName>areasymbol</PropertyName>
          <Literal>CA011</Literal>
        </PropertyIsEqualTo>
      </Or>
     </Filter>
   </Query>
</GetFeature>

But with this I get the error:

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://web1.cei.psu.edu:8080/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd"
>
<ServiceException>
    No request recognized.  The REQUEST parameter must be one of GetFeature,
GetFeatureWithLock, DescribeFeatureType, LockFeature, or Transaction.  
</ServiceException>
</ServiceExceptionReport>


Is the format correct for my xml?  How does it know that request= this xml?
Do I need all the namespaces and schemas and such in the xml (which I always
see in the examples from the spec, but usually don't seem necessary in most
of my queries/filters)? And is there a more elegant way to do this request?
I have the client doing some agraggating of the attributes of some features,
and then going back to get the_geom (which is the point of this query).

Thanks,
Steve



Stephen Crawford
Center for Environmental Informatics
GeoVISTA Center
The Pennsylvania State University
814.865.9905
[hidden email]


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Xml query help

Randy George
Hi Stephen,

        Perhaps you could try adding the namespaces like this and see if you
get results:
<?xml version='1.0' encoding='UTF-16' standalone='yes'?>
<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">

  <wfs:Query typeName="cei:ssa_48">
    <ogc:PropertyName>areasymbol</ogc:PropertyName>
    <ogc:PropertyName>areaname</ogc:PropertyName>
    <ogc:PropertyName>the_geom</ogc:PropertyName>
    <ogc:Filter>
      <ogc:Or>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>areasymbol</ogc:PropertyName>
          <ogc:Literal>CA011</ogc:Literal>
        </ogc:PropertyIsEqualTo>
      </ogc:Or>
     </ogc:Filter>
   </wfs:Query>
</wfs:GetFeature>


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Stephen
Crawford
Sent: Thursday, July 06, 2006 8:51 AM
To: geoServer
Subject: [Geoserver-users] Xml query help

All,

I have a Geoserver request that works via the url, and looks like this:

http://web1.cei.psu.edu:8080/geoserver/wfs?request=GetFeature&typeName=cei:s
sa_48&PropertyName=areasymbol,areaname,the_geom&Filter=<Filter><Or><Property
IsEqualTo><PropertyName>areasymbol</PropertyName><Literal>CA011</Literal></P
ropertyIsEqualTo></Or></Filter>        

This is to get a few attributes for one feature, which has areasymbol=CA011.
My problem is that I would like to do this for many (300?) features, but it
seems to break at about 50 features....I guess the url string is too long?

So I tried doing the same request via xml, which looks like this (again, for
one feature):

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2">
  <Query typeName="cei:ssa_48">
    <PropertyName>areasymbol</PropertyName>
    <PropertyName>areaname</PropertyName>
    <PropertyName>the_geom</PropertyName>
    <Filter>
      <Or>
        <PropertyIsEqualTo>
          <PropertyName>areasymbol</PropertyName>
          <Literal>CA011</Literal>
        </PropertyIsEqualTo>
      </Or>
     </Filter>
   </Query>
</GetFeature>

But with this I get the error:

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://web1.cei.psu.edu:8080/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd"
>
<ServiceException>
    No request recognized.  The REQUEST parameter must be one of GetFeature,
GetFeatureWithLock, DescribeFeatureType, LockFeature, or Transaction.  
</ServiceException>
</ServiceExceptionReport>


Is the format correct for my xml?  How does it know that request= this xml?
Do I need all the namespaces and schemas and such in the xml (which I always
see in the examples from the spec, but usually don't seem necessary in most
of my queries/filters)? And is there a more elegant way to do this request?
I have the client doing some agraggating of the attributes of some features,
and then going back to get the_geom (which is the point of this query).

Thanks,
Steve



Stephen Crawford
Center for Environmental Informatics
GeoVISTA Center
The Pennsylvania State University
814.865.9905
[hidden email]


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Xml query help

Stephen Crawford
I tried it like this:

<?xml version="1.0" encoding="UTF-16" standalone="yes" ?>
<wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wfs
http://web1.cei.psu.edu:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">
  <wfs:Query typeName="cei:ssa_48">
    <ogc:PropertyName>areasymbol</ogc:PropertyName>
    <ogc:PropertyName>areaname</ogc:PropertyName>
    <ogc:PropertyName>the_geom</ogc:PropertyName>
    <ogc:Filter>
      <ogc:Or>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>areasymbol</ogc:PropertyName>
          <ogc:Literal>CA011</ogc:Literal>
        </ogc:PropertyIsEqualTo>
       </ogc:Or>
     </ogc:Filter>
   </wfs:Query>
 </wfs:GetFeature>

Yet I still get this error:

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://web1.cei.psu.edu:8080/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd"
>
<ServiceException>
    No request recognized.  The REQUEST parameter must be one of GetFeature,
GetFeatureWithLock, DescribeFeatureType, LockFeature, or Transaction.  
</ServiceException>
</ServiceExceptionReport>

Any thoughts?  Am I correct that the url for the service is the same as it
is for sending values thru the url string:  ...../geoserver/wfs?  ?  Should
I be able just to tack this xml onto the end of  ..../geoserver/wfs? And
have it work.  It seems like there should be something in there saying
"request=" and then the xml.

Thanks again,
Steve



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Randy
George
Sent: Thursday, July 06, 2006 11:15 AM
To: 'Stephen Crawford'
Cc: [hidden email]
Subject: Re: [Geoserver-users] Xml query help

Hi Stephen,

        Perhaps you could try adding the namespaces like this and see if you
get results:
<?xml version='1.0' encoding='UTF-16' standalone='yes'?> <wfs:GetFeature
service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">

  <wfs:Query typeName="cei:ssa_48">
    <ogc:PropertyName>areasymbol</ogc:PropertyName>
    <ogc:PropertyName>areaname</ogc:PropertyName>
    <ogc:PropertyName>the_geom</ogc:PropertyName>
    <ogc:Filter>
      <ogc:Or>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>areasymbol</ogc:PropertyName>
          <ogc:Literal>CA011</ogc:Literal>
        </ogc:PropertyIsEqualTo>
      </ogc:Or>
     </ogc:Filter>
   </wfs:Query>
</wfs:GetFeature>


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Stephen
Crawford
Sent: Thursday, July 06, 2006 8:51 AM
To: geoServer
Subject: [Geoserver-users] Xml query help

All,

I have a Geoserver request that works via the url, and looks like this:

http://web1.cei.psu.edu:8080/geoserver/wfs?request=GetFeature&typeName=cei:s
sa_48&PropertyName=areasymbol,areaname,the_geom&Filter=<Filter><Or><Property
IsEqualTo><PropertyName>areasymbol</PropertyName><Literal>CA011</Literal
IsEqualTo>></P
ropertyIsEqualTo></Or></Filter>        

This is to get a few attributes for one feature, which has areasymbol=CA011.
My problem is that I would like to do this for many (300?) features, but it
seems to break at about 50 features....I guess the url string is too long?

So I tried doing the same request via xml, which looks like this (again, for
one feature):

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2">
  <Query typeName="cei:ssa_48">
    <PropertyName>areasymbol</PropertyName>
    <PropertyName>areaname</PropertyName>
    <PropertyName>the_geom</PropertyName>
    <Filter>
      <Or>
        <PropertyIsEqualTo>
          <PropertyName>areasymbol</PropertyName>
          <Literal>CA011</Literal>
        </PropertyIsEqualTo>
      </Or>
     </Filter>
   </Query>
</GetFeature>

But with this I get the error:

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://web1.cei.psu.edu:8080/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd"
>
<ServiceException>
    No request recognized.  The REQUEST parameter must be one of GetFeature,
GetFeatureWithLock, DescribeFeatureType, LockFeature, or Transaction.  
</ServiceException>
</ServiceExceptionReport>


Is the format correct for my xml?  How does it know that request= this xml?
Do I need all the namespaces and schemas and such in the xml (which I always
see in the examples from the spec, but usually don't seem necessary in most
of my queries/filters)? And is there a more elegant way to do this request?
I have the client doing some agraggating of the attributes of some features,
and then going back to get the_geom (which is the point of this query).

Thanks,
Steve



Stephen Crawford
Center for Environmental Informatics
GeoVISTA Center
The Pennsylvania State University
814.865.9905
[hidden email]


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Xml query help

sfarber
Steve,

How, exactly, are you sending this "all-xml" request?

If you're trying to send it by creating a url like this:

http://my-server:8080/geoserver/wfs?<XML REQUEST HERE...>

then that won't work.


urls in the browser address-bar are fetched via "GET", while an all-xml
request must be sent via POST.

If you have a unix box (or cygwin) around, you can try the following
command-line-based method.

1)  Save your XML query to a file (perhaps called "query.xml")
2)  use the following command-line with a recent version of 'wget', all
on one line:

$ wget -O result_file_name.xml --post-file=query.xml
http://server:8080/geoserver/wfs


This will open a TCP connection to port 8080 on your geoserver server
machine, and then use HTTP-POST to deposit the body of the XML request
into the HTTP request, and should get you what you're looking for.

Let me know if that works for you!

--saul

Stephen Crawford wrote:
>
> Any thoughts?  Am I correct that the url for the service is the same as it
> is for sending values thru the url string:  ...../geoserver/wfs?  ?  Should
> I be able just to tack this xml onto the end of  ..../geoserver/wfs? And
> have it work.  It seems like there should be something in there saying
> "request=" and then the xml.
>
> Thanks again,
> Steve

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Xml query help

Randy George
In reply to this post by Stephen Crawford
Hi Steve,

        Another way to test this is to use the GeoServer "Demo Request".
Paste in your url into the 'url:' text box for example:
http://localhost:80/geoserver/wfs
Then paste a copy of the xml into the 'body:' text box. Then hit submit to
send a Post and examine the resulting GML.

Randy George


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Stephen
Crawford
Sent: Thursday, July 06, 2006 10:22 AM
To: 'Randy George'
Cc: [hidden email]
Subject: Re: [Geoserver-users] Xml query help

I tried it like this:

<?xml version="1.0" encoding="UTF-16" standalone="yes" ?>
<wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wfs
http://web1.cei.psu.edu:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">
  <wfs:Query typeName="cei:ssa_48">
    <ogc:PropertyName>areasymbol</ogc:PropertyName>
    <ogc:PropertyName>areaname</ogc:PropertyName>
    <ogc:PropertyName>the_geom</ogc:PropertyName>
    <ogc:Filter>
      <ogc:Or>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>areasymbol</ogc:PropertyName>
          <ogc:Literal>CA011</ogc:Literal>
        </ogc:PropertyIsEqualTo>
       </ogc:Or>
     </ogc:Filter>
   </wfs:Query>
 </wfs:GetFeature>

Yet I still get this error:

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://web1.cei.psu.edu:8080/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd"
>
<ServiceException>
    No request recognized.  The REQUEST parameter must be one of GetFeature,
GetFeatureWithLock, DescribeFeatureType, LockFeature, or Transaction.  
</ServiceException>
</ServiceExceptionReport>

Any thoughts?  Am I correct that the url for the service is the same as it
is for sending values thru the url string:  ...../geoserver/wfs?  ?  Should
I be able just to tack this xml onto the end of  ..../geoserver/wfs? And
have it work.  It seems like there should be something in there saying
"request=" and then the xml.

Thanks again,
Steve



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Randy
George
Sent: Thursday, July 06, 2006 11:15 AM
To: 'Stephen Crawford'
Cc: [hidden email]
Subject: Re: [Geoserver-users] Xml query help

Hi Stephen,

        Perhaps you could try adding the namespaces like this and see if you
get results:
<?xml version='1.0' encoding='UTF-16' standalone='yes'?> <wfs:GetFeature
service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">

  <wfs:Query typeName="cei:ssa_48">
    <ogc:PropertyName>areasymbol</ogc:PropertyName>
    <ogc:PropertyName>areaname</ogc:PropertyName>
    <ogc:PropertyName>the_geom</ogc:PropertyName>
    <ogc:Filter>
      <ogc:Or>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>areasymbol</ogc:PropertyName>
          <ogc:Literal>CA011</ogc:Literal>
        </ogc:PropertyIsEqualTo>
      </ogc:Or>
     </ogc:Filter>
   </wfs:Query>
</wfs:GetFeature>


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Stephen
Crawford
Sent: Thursday, July 06, 2006 8:51 AM
To: geoServer
Subject: [Geoserver-users] Xml query help

All,

I have a Geoserver request that works via the url, and looks like this:

http://web1.cei.psu.edu:8080/geoserver/wfs?request=GetFeature&typeName=cei:s
sa_48&PropertyName=areasymbol,areaname,the_geom&Filter=<Filter><Or><Property
IsEqualTo><PropertyName>areasymbol</PropertyName><Literal>CA011</Literal
IsEqualTo>></P
ropertyIsEqualTo></Or></Filter>        

This is to get a few attributes for one feature, which has areasymbol=CA011.
My problem is that I would like to do this for many (300?) features, but it
seems to break at about 50 features....I guess the url string is too long?

So I tried doing the same request via xml, which looks like this (again, for
one feature):

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2">
  <Query typeName="cei:ssa_48">
    <PropertyName>areasymbol</PropertyName>
    <PropertyName>areaname</PropertyName>
    <PropertyName>the_geom</PropertyName>
    <Filter>
      <Or>
        <PropertyIsEqualTo>
          <PropertyName>areasymbol</PropertyName>
          <Literal>CA011</Literal>
        </PropertyIsEqualTo>
      </Or>
     </Filter>
   </Query>
</GetFeature>

But with this I get the error:

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://web1.cei.psu.edu:8080/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd"
>
<ServiceException>
    No request recognized.  The REQUEST parameter must be one of GetFeature,
GetFeatureWithLock, DescribeFeatureType, LockFeature, or Transaction.  
</ServiceException>
</ServiceExceptionReport>


Is the format correct for my xml?  How does it know that request= this xml?
Do I need all the namespaces and schemas and such in the xml (which I always
see in the examples from the spec, but usually don't seem necessary in most
of my queries/filters)? And is there a more elegant way to do this request?
I have the client doing some agraggating of the attributes of some features,
and then going back to get the_geom (which is the point of this query).

Thanks,
Steve



Stephen Crawford
Center for Environmental Informatics
GeoVISTA Center
The Pennsylvania State University
814.865.9905
[hidden email]


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Xml query help

Stephen Crawford
Randy et al,

Thanks for all your help.  I'm using Flashas my client, and the sendXML
method is supposed to use POST, but in the fine print they say that in test
mode it only uses GET!  So that was one of the problems; I later found
through the error logs that the xerces jar was not present, so even when the
xml request was good it wasn't being parsed....so I loaded that and
everything is working great.

Thanks,
Steve

 

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Randy
George
Sent: Thursday, July 06, 2006 1:49 PM
To: 'Stephen Crawford'
Cc: [hidden email]
Subject: Re: [Geoserver-users] Xml query help

Hi Steve,

        Another way to test this is to use the GeoServer "Demo Request".
Paste in your url into the 'url:' text box for example:
http://localhost:80/geoserver/wfs
Then paste a copy of the xml into the 'body:' text box. Then hit submit to
send a Post and examine the resulting GML.

Randy George


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Stephen
Crawford
Sent: Thursday, July 06, 2006 10:22 AM
To: 'Randy George'
Cc: [hidden email]
Subject: Re: [Geoserver-users] Xml query help

I tried it like this:

<?xml version="1.0" encoding="UTF-16" standalone="yes" ?> <wfs:GetFeature
service="WFS" version="1.0.0" outputFormat="GML2"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wfs
http://web1.cei.psu.edu:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">
  <wfs:Query typeName="cei:ssa_48">
    <ogc:PropertyName>areasymbol</ogc:PropertyName>
    <ogc:PropertyName>areaname</ogc:PropertyName>
    <ogc:PropertyName>the_geom</ogc:PropertyName>
    <ogc:Filter>
      <ogc:Or>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>areasymbol</ogc:PropertyName>
          <ogc:Literal>CA011</ogc:Literal>
        </ogc:PropertyIsEqualTo>
       </ogc:Or>
     </ogc:Filter>
   </wfs:Query>
 </wfs:GetFeature>

Yet I still get this error:

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://web1.cei.psu.edu:8080/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd"
>
<ServiceException>
    No request recognized.  The REQUEST parameter must be one of GetFeature,
GetFeatureWithLock, DescribeFeatureType, LockFeature, or Transaction.  
</ServiceException>
</ServiceExceptionReport>

Any thoughts?  Am I correct that the url for the service is the same as it
is for sending values thru the url string:  ...../geoserver/wfs?  ?  Should
I be able just to tack this xml onto the end of  ..../geoserver/wfs? And
have it work.  It seems like there should be something in there saying
"request=" and then the xml.

Thanks again,
Steve



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Randy
George
Sent: Thursday, July 06, 2006 11:15 AM
To: 'Stephen Crawford'
Cc: [hidden email]
Subject: Re: [Geoserver-users] Xml query help

Hi Stephen,

        Perhaps you could try adding the namespaces like this and see if you
get results:
<?xml version='1.0' encoding='UTF-16' standalone='yes'?> <wfs:GetFeature
service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd">

  <wfs:Query typeName="cei:ssa_48">
    <ogc:PropertyName>areasymbol</ogc:PropertyName>
    <ogc:PropertyName>areaname</ogc:PropertyName>
    <ogc:PropertyName>the_geom</ogc:PropertyName>
    <ogc:Filter>
      <ogc:Or>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>areasymbol</ogc:PropertyName>
          <ogc:Literal>CA011</ogc:Literal>
        </ogc:PropertyIsEqualTo>
      </ogc:Or>
     </ogc:Filter>
   </wfs:Query>
</wfs:GetFeature>


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Stephen
Crawford
Sent: Thursday, July 06, 2006 8:51 AM
To: geoServer
Subject: [Geoserver-users] Xml query help

All,

I have a Geoserver request that works via the url, and looks like this:

http://web1.cei.psu.edu:8080/geoserver/wfs?request=GetFeature&typeName=cei:s
sa_48&PropertyName=areasymbol,areaname,the_geom&Filter=<Filter><Or><Property
IsEqualTo><PropertyName>areasymbol</PropertyName><Literal>CA011</Literal
IsEqualTo>></P
ropertyIsEqualTo></Or></Filter>        

This is to get a few attributes for one feature, which has areasymbol=CA011.
My problem is that I would like to do this for many (300?) features, but it
seems to break at about 50 features....I guess the url string is too long?

So I tried doing the same request via xml, which looks like this (again, for
one feature):

<GetFeature service="WFS" version="1.0.0" outputFormat="GML2">
  <Query typeName="cei:ssa_48">
    <PropertyName>areasymbol</PropertyName>
    <PropertyName>areaname</PropertyName>
    <PropertyName>the_geom</PropertyName>
    <Filter>
      <Or>
        <PropertyIsEqualTo>
          <PropertyName>areasymbol</PropertyName>
          <Literal>CA011</Literal>
        </PropertyIsEqualTo>
      </Or>
     </Filter>
   </Query>
</GetFeature>

But with this I get the error:

<ServiceExceptionReport version="1.2.0"
xsi:schemaLocation="http://www.opengis.net/ogc
http://web1.cei.psu.edu:8080/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd"
>
<ServiceException>
    No request recognized.  The REQUEST parameter must be one of GetFeature,
GetFeatureWithLock, DescribeFeatureType, LockFeature, or Transaction.  
</ServiceException>
</ServiceExceptionReport>


Is the format correct for my xml?  How does it know that request= this xml?
Do I need all the namespaces and schemas and such in the xml (which I always
see in the examples from the spec, but usually don't seem necessary in most
of my queries/filters)? And is there a more elegant way to do this request?
I have the client doing some agraggating of the attributes of some features,
and then going back to get the_geom (which is the point of this query).

Thanks,
Steve



Stephen Crawford
Center for Environmental Informatics
GeoVISTA Center
The Pennsylvania State University
814.865.9905
[hidden email]


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users