Hello!
Below is two examples of XML code for WFS-T Insert and WFS-T Update that I’ve used. Both of them works but look at the dateformat, I can’t use the same dateformat for the insert-xml as in the update-xml, if I do that I’ll get IllegalArgumentExeption “parsing faild for validtime”. I’m using Geoserver 1.6.4. Is it me that’s using the WFS-T in a non-standard way, a bug or is this the normal behaivior?
<wfs:Transaction xmlns:wfs=“http://www.opengis.net/wfs” version=“1.0.0” xmlns:smhi=“http://www.smhi.se” service=“WFS”><wfs:Update typeName=“smhi:wind”>wfs:Propertywfs:Namewindgeometry</wfs:Name>wfs:Value<gml:Polygon xmlns:gml=“http://www.opengis.net/gml” srsName=“EPSG:4326”>gml:outerBoundaryIsgml:LinearRing<gml:coordinates decimal=“.” cs=“,” ts=" ">14.40657279125,61.900057868125 15.90084982,60.02674579 17.98443694,60.3690318 26.83560219,71.65370062 17.06112604,58.44056756 19.58366756,58.31914873 20.44360986,61.18612513 14.40657279125,61.900057868125</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></wfs:Value></wfs:Property>wfs:Propertywfs:Nameminwindspeed</wfs:Name>wfs:Value10</wfs:Value></wfs:Property>wfs:Propertywfs:Namemaxwindspeed</wfs:Name>wfs:Value20</wfs:Value></wfs:Property>wfs:Propertywfs:Nameforecastrun</wfs:Name>wfs:Value2008-09-03 06:00:00+00</wfs:Value></wfs:Property>wfs:Propertywfs:Namevalidtime</wfs:Name>wfs:Value2008-09-03 16:00:00+00</wfs:Value></wfs:Property><ogc:Filter xmlns:ogc=“http://www.opengis.net/ogc”><ogc:FeatureId fid=“wind.12”/></ogc:Filter></wfs:Update></wfs:Transaction>
<wfs:Transaction xmlns:wfs=“http://www.opengis.net/wfs” version=“1.0.0” xmlns:smhi=“http://www.smhi.se” service=“WFS”>wfs:Insert<smhi:wind xmlns:smhi=“smhi”>smhi:windgeometry<gml:Polygon xmlns:gml=“http://www.opengis.net/gml”>gml:outerBoundaryIsgml:LinearRing<gml:coordinates decimal=“.” cs=“,” ts=" ">12.9462890625,64.669921875 12.638671875,60.73681640625 14.85791015625,59.044921875 15.16552734375,61.96728515625 12.9462890625,64.669921875</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>a</gml:Polygon></smhi:windgeometry>smhi:validtime2008-09-03T16:00:00Z</smhi:validtime>smhi:forecastrun2008-09-03T06:00:00Z</smhi:forecastrun>smhi:minwindspeed8</smhi:minwindspeed>smhi:maxwindspeed8</smhi:maxwindspeed></smhi:wind></wfs:Insert></wfs:Transaction>
Best regards**:**
Mårten Swärd
Systemdeveloper
SMHI, Swedish Meteorological and Hydrological Institut
Tel: +46 11 495 8469
Swärd Mårten ha scritto:
Hello!
Below is two examples of XML code for WFS-T Insert and WFS-T Update that I’ve used. Both of them works but look at the dateformat, I can’t use the same dateformat for the insert-xml as in the update-xml, if I do that I’ll get IllegalArgumentExeption “parsing faild for validtime”. I’m using Geoserver 1.6.4. Is it me that’s using the WFS-T in a non-standard way, a bug or is this the normal behaivior?
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" version="1.0.0" xmlns:smhi="http://www.smhi.se" service="WFS"><wfs:Update typeName="smhi:wind"><wfs:Property><wfs:Name>windgeometry</wfs:Name><wfs:Value><gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts=" ">14.40657279125,61.900057868125 15.90084982,60.02674579 17.98443694,60.3690318 26.83560219,71.65370062 17.06112604,58.44056756 19.58366756,58.31914873 20.44360986,61.18612513 14.40657279125,61.900057868125</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></wfs:Value></wfs:Property><wfs:Property><wfs:Name>minwindspeed</wfs:Name><wfs:Value>10</wfs:Value></wfs:Property><wfs:Property><wfs:Name>maxwindspeed</wfs:Name><wfs:Value>20</wfs:Value></wfs:Property><wfs:Property><wfs:Name>forecastrun</wfs:Name><wfs:Value>2008-09-03 06:00:00+00</wfs:Value></wfs:Property><wfs:Property><wfs:Name>validtime</wfs:Name><wfs:Value>***2008-09-03 16:00:00+00*</wfs:Value></wfs:Property><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:FeatureId fid="wind.12"/></ogc:Filter></wfs:Update></wfs:Transaction>
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" version="1.0.0" xmlns:smhi="http://www.smhi.se" service="WFS"><wfs:Insert><smhi:wind xmlns:smhi="smhi"><smhi:windgeometry><gml:Polygon xmlns:gml="http://www.opengis.net/gml"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts=" ">12.9462890625,64.669921875 12.638671875,60.73681640625 14.85791015625,59.044921875 15.16552734375,61.96728515625 12.9462890625,64.669921875</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>a</gml:Polygon></smhi:windgeometry><smhi:validtime>***2008-09-****0****3T16:00:00Z*</smhi:validtime><smhi:forecastrun>2008-09-03T06:00:00Z</smhi:forecastrun><smhi:minwindspeed>8</smhi:minwindspeed><smhi:maxwindspeed>8</smhi:maxwindspeed></smhi:wind></wfs:Insert></wfs:Transaction>
Oh hum, this is nasty... insert and update are hitting two
different code paths in the xml parser, maybe that could explain
why there is a different behaviour. Sounds like a bug to me,
can you open a request on jira.codehaus.org?
Cheers
Andrea
Hi Mårten,
There are a couple of issues here. The reason for the exception is that a "datetime" literal is being used when just a "date" literal is expected, if you drop the time component it should work.
But yes, the code paths are using different methods of parsing the date, which is an issue.
-Justin
Andrea Aime wrote:
Swärd Mårten ha scritto:
Hello!
Below is two examples of XML code for WFS-T Insert and WFS-T Update that I’ve used. Both of them works but look at the dateformat, I can’t use the same dateformat for the insert-xml as in the update-xml, if I do that I’ll get IllegalArgumentExeption “parsing faild for validtime”. I’m using Geoserver 1.6.4. Is it me that’s using the WFS-T in a non-standard way, a bug or is this the normal behaivior?
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" version="1.0.0" xmlns:smhi="http://www.smhi.se" service="WFS"><wfs:Update typeName="smhi:wind"><wfs:Property><wfs:Name>windgeometry</wfs:Name><wfs:Value><gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts=" ">14.40657279125,61.900057868125 15.90084982,60.02674579 17.98443694,60.3690318 26.83560219,71.65370062 17.06112604,58.44056756 19.58366756,58.31914873 20.44360986,61.18612513 14.40657279125,61.900057868125</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></wfs:Value></wfs:Property><wfs:Property><wfs:Name>minwindspeed</wfs:Name><wfs:Value>10</wfs:Value></wfs:Property><wfs:Property><wfs:Name>maxwindspeed</wfs:Name><wfs:Value>20</wfs:Value></wfs:Property><wfs:Property><wfs:Name>forecastrun</wfs:Name><wfs:Value>2008-09-03 06:00:00+00</wfs:Value></wfs:Property><wfs:Property><wfs:Name>validtime</wfs:Name><wfs:Value>***2008-09-03 16:00:00+00*</wfs:Value></wfs:Property><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:FeatureId fid="wind.12"/></ogc:Filter></wfs:Update></wfs:Transaction>
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" version="1.0.0" xmlns:smhi="http://www.smhi.se" service="WFS"><wfs:Insert><smhi:wind xmlns:smhi="smhi"><smhi:windgeometry><gml:Polygon xmlns:gml="http://www.opengis.net/gml"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts=" ">12.9462890625,64.669921875 12.638671875,60.73681640625 14.85791015625,59.044921875 15.16552734375,61.96728515625 12.9462890625,64.669921875</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>a</gml:Polygon></smhi:windgeometry><smhi:validtime>***2008-09-****0****3T16:00:00Z*</smhi:validtime><smhi:forecastrun>2008-09-03T06:00:00Z</smhi:forecastrun><smhi:minwindspeed>8</smhi:minwindspeed><smhi:maxwindspeed>8</smhi:maxwindspeed></smhi:wind></wfs:Insert></wfs:Transaction>
Oh hum, this is nasty... insert and update are hitting two
different code paths in the xml parser, maybe that could explain
why there is a different behaviour. Sounds like a bug to me,
can you open a request on jira.codehaus.org?
Cheers
Andrea
--
Justin Deoliveira
Software Engineer, OpenGeo
http://opengeo.org
Hello Justin!
I'm not sure what you mean, but the time component is necessary for the functionality of the application that we are buliding, so unfortunately it's not an option to drop it. I just saw that this issue will be fixed to version 1.7.1, I'll make a workaround in the application until then.
Best regards:
Mårten Swärd
Systemdeveloper
SMHI, Swedish Meteorological and Hydrological Institut
Phone: +46 11 495 8469
-----Ursprungligt meddelande-----
Från: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Skickat: den 10 september 2008 16:25
Till: Andrea Aime
Kopia: Swärd Mårten; geoserver-users@lists.sourceforge.net; Justin Deoliveira
Ämne: Re: [Geoserver-users] WFS-T and dateformats?
Hi Mårten,
There are a couple of issues here. The reason for the exception is that
a "datetime" literal is being used when just a "date" literal is
expected, if you drop the time component it should work.
But yes, the code paths are using different methods of parsing the date,
which is an issue.
-Justin
Andrea Aime wrote:
Swärd Mårten ha scritto:
Hello!
Below is two examples of XML code for WFS-T Insert and WFS-T Update
that I've used. Both of them works but look at the dateformat, I can't
use the same dateformat for the insert-xml as in the update-xml, if I
do that I'll get IllegalArgumentExeption "parsing faild for
validtime". I'm using Geoserver 1.6.4. Is it me that's using the WFS-T
in a non-standard way, a bug or is this the normal behaivior?
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs"
version="1.0.0" xmlns:smhi="http://www.smhi.se"
service="WFS"><wfs:Update
typeName="smhi:wind"><wfs:Property><wfs:Name>windgeometry</wfs:Name><wfs:Value><gml:Polygon
xmlns:gml="http://www.opengis.net/gml"
srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates
decimal="." cs="," ts=" ">14.40657279125,61.900057868125
15.90084982,60.02674579 17.98443694,60.3690318 26.83560219,71.65370062
17.06112604,58.44056756 19.58366756,58.31914873
20.44360986,61.18612513
14.40657279125,61.900057868125</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></wfs:Value></wfs:Property><wfs:Property><wfs:Name>minwindspeed</wfs:Name><wfs:Value>10</wfs:Value></wfs:Property><wfs:Property><wfs:Name>maxwindspeed</wfs:Name><wfs:Value>20</wfs:Value></wfs:Property><wfs:Property><wfs:Name>forecastrun</wfs:Name><wfs:Value>2008-09-03
06:00:00+00</wfs:Value></wfs:Property><wfs:Property><wfs:Name>validtime</wfs:Name><wfs:Value>***2008-09-03
16:00:00+00*</wfs:Value></wfs:Property><ogc:Filter
xmlns:ogc="http://www.opengis.net/ogc"><ogc:FeatureId
fid="wind.12"/></ogc:Filter></wfs:Update></wfs:Transaction>
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs"
version="1.0.0" xmlns:smhi="http://www.smhi.se"
service="WFS"><wfs:Insert><smhi:wind
xmlns:smhi="smhi"><smhi:windgeometry><gml:Polygon
xmlns:gml="http://www.opengis.net/gml"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates
decimal="." cs="," ts=" ">12.9462890625,64.669921875
12.638671875,60.73681640625 14.85791015625,59.044921875
15.16552734375,61.96728515625
12.9462890625,64.669921875</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>a</gml:Polygon></smhi:windgeometry><smhi:validtime>***2008-09-****0****3T16:00:00Z*</smhi:validtime><smhi:forecastrun>2008-09-03T06:00:00Z</smhi:forecastrun><smhi:minwindspeed>8</smhi:minwindspeed><smhi:maxwindspeed>8</smhi:maxwindspeed></smhi:wind></wfs:Insert></wfs:Transaction>
Oh hum, this is nasty... insert and update are hitting two
different code paths in the xml parser, maybe that could explain
why there is a different behaviour. Sounds like a bug to me,
can you open a request on jira.codehaus.org?
Cheers
Andrea
--
Justin Deoliveira
Software Engineer, OpenGeo
http://opengeo.org