#2476 closed defect (fixed)
A post request in XML encoding to a WCS 1.0.0 server returns the template specified in the Web object instead the expected response
Reported by: | nsavard | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 5.2 release |
Component: | WCS Server | Version: | 5.0 |
Severity: | normal | Keywords: | OGC, Cite, TEAM, LEGACY, WCS 1.0.0 |
Cc: | tomkralidis, sdlime, dmorissette |
Description (last modified by )
A DescribeCoverage, GetCoverage or GetCapabilities request in a form of a post using XML encoding, sends to a WCS 1.0.0 server does not return the expected result. The template in the Web object of the map is returned instead.
I found a thread about a similar issue on the Web:
(see:http://lists.umn.edu/cgi-bin/wa?A2=ind0711&L=mapserver-users&P=16208)
An example of the request sent is:
http://dev1.lan.mapgears.com/manwe/cgi-bin/mswcs100_ogc_cite?
Content sent:
<GetCoverage xmlns="http://www.opengis.net/wcs" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs http://schemas.opengis.net/wcs/1.0.0/getCoverage.xsd" version="1.0.0" service="WCS" ><domainSubset><spatialSubset><gml:Envelope srsName="WGS84(DD)"> <gml:pos>-97.7071758865421 41.0324719184183</gml:pos><gml:pos>-80.6778361148771 49.6650665681236</gml:pos> </gml:Envelope> <gml:Grid dimension="2"><gml:limits><gml:GridEnvelope><gml:low>0 0 </gml:low><gml:high>200 100 </gml:high></gml:GridEnvelope></gml:limits><gml:axisName>width</gml:axisName><gml:axisName>height</gml:axisName></gml:Grid></spatialSubset></domainSubset> <output><format>GEOTIFF_INT16</format></output></GetCoverage>
The following tests are concerned by this issue:
wcs1-0-0/describecoverage_operations/describecoverage_request/post/xml/1 ,2,5,6,7 wcs1-0-0/getcapabilities_operations/getcapabilities_request/post/xml/2,3,4,5,6,7 wcs1-0-0/getcoverage_operations/getcoverage_request/bbox/post/xml/3,4 wcs1-0-0/getcoverage_operations/getcoverage_request/coverage/post/xml/1,3 wcs1-0-0/getcoverage_operations/getcoverage_request/crs/post/xml/3 wcs1-0-0/getcoverage_operations/getcoverage_request/format/post/xml/2,3 wcs1-0-0/getcoverage_operations/getcoverage_request/interpolationmethod/post/xml/2,3 wcs1-0-0/getcoverage_operations/getcoverage_request/parameter/post/xml/3,4 wcs1-0-0/getcoverage_operations/getcoverage_request/response_crs/post/xml/2,3 wcs1-0-0/getcoverage_operations/getcoverage_request/service_version/post/xml/1,2,3
Change History (15)
comment:1 by , 16 years ago
Cc: | added; removed |
---|
comment:2 by , 16 years ago
Cc: | added |
---|
comment:3 by , 16 years ago
I'm not interested in support the XML post format for WCS. But we clearly should throw a meaningful exception. I'd be willing to implement this (a reasonable exception report) since I'm digging around in WCS anyways as long as someone else is willing to verify my work once done.
follow-up: 9 comment:4 by , 16 years ago
Basically, in msWCSParseRequest(), you can check for request->postrequest. If it's set, we can throw an exception.
Norm: what implications does not supporting XML POST have on the CITE tests?
comment:5 by , 16 years ago
Cc: | added; removed |
---|---|
Description: | modified (diff) |
Owner: | changed from | to
Taking this ticket.
Note, I don't think it is quite so simple. We need to ensure we don't interfere with other kinds of POST responses that aren't WCS related. We also have to ensure we don't interfere with WCS KVP post requests (which I have confirmed work).
I think we may need to actually consume the post document at some appropriate point and issue an error if we can determine it is WCS.
comment:6 by , 16 years ago
Description: | modified (diff) |
---|
comment:7 by , 16 years ago
Thanks for taking, let me know how I can help. For some reason I don't think any of the WxS services were supporting XML requests so I didn't go there. I don't believe it is required. It may be just as easy to support XML as figure out how to ignore it.
Steve
comment:8 by , 16 years ago
Status: | new → assigned |
---|
I think I have added appropriate code in msWCSParseRequest() to recognise and issue an exception for WCS XML Posts without screwing up non-WCS requests or WCS KVP POST requests (which work fine).
Change is r7294 in trunk.
If there is no objection after some testing in trunk, I think this change could be put into 5.0 branch.
follow-up: 10 comment:9 by , 16 years ago
Replying to tomkralidis:
Basically, in msWCSParseRequest(), you can check for request->postrequest. If it's set, we can throw an exception.
Norm: what implications does not supporting XML POST have on the CITE tests?
Tom, I'm checking that.
comment:10 by , 16 years ago
Replying to nsavard:
Replying to tomkralidis:
Basically, in msWCSParseRequest(), you can check for request->postrequest. If it's set, we can throw an exception.
Norm: what implications does not supporting XML POST have on the CITE tests?
Tom, I'm checking that.
I checked the test requirements and assertions document, all XML post tests are optional apart the four tests below that are mandatory (class A or B). I don't know why, I need to validate on the mailing list. It is also said in this same document that XML encoding is a user selected option.
wcs/1.0.0/getcoverage_operations/getcoverage_request/coverage/post/xml/1 wcs/1.0.0/getcoverage_operations/getcoverage_request/interpolationmethod/post/xml/1 wcs/1.0.0/getcoverage_operations/getcoverage_request/interpolationmethod/post/xml/2 wcs/1.0.0/getcoverage_operations/getcoverage_request/interpolationmethod/post/xml/3
I also verified my configuration for the tests and noticed that I can set the tests engine to execute or not execute XML post tests. I changed this configuration to not execute the XML post tests and all of them vanished from the tests suite.
To what I understand it is optional and has no impact on the WCS 1.0.0 compliance.
follow-up: 13 comment:11 by , 16 years ago
Cc: | added |
---|
I've tested this and it works fine for me. Is it too late to slip this into 5.0.1 for today?
comment:12 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Tom,
I could quickly retrofit it, but honestly I'm not sure it fits the "bug fix" category and there is a non-trivial risk it will introduce a bug.
In my opinion the value (minor) isn't worth the risk of retrofitting this into 5.0 branch.
(I know, it was me that suggested it earlier, but I've slept on the idea.)
I'm going to close on the basis of that opinion.
comment:13 by , 16 years ago
Replying to tomkralidis:
I've tested this and it works fine for me. Is it too late to slip this into 5.0.1 for today?
Tom: I checked with wget and I'm still getting an HTML template. Maybe I don't test it the right way. Here is my wget command:
wget http://dev1.lan.mapgears.com/manwe/cgi-bin/mswcs100_ogc_cite? --post-file=post.txt
and post.txt: <DescribeCoverage xmlns="http://www.opengis.net/wcs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs http://schemas.opengis.net/wcs/1.0.0/describeCoverage.xsd" service="WCS" version="0.0.0"> <Coverage>ndvi</Coverage> </DescribeCoverage >
follow-up: 15 comment:14 by , 16 years ago
Normand,
I found that wget sends the Content-type of posts as application/x-www-form-urlencoded which interferes with it being recognised as a XML post request. It could be anything else, but according to the standard I assume it is supposed to be something like text/xml.
Based on this I wasn't able to text with wget, and had to use a little web app Tom had that sets the content type properly. Other tools (perhaps curl or python http posting) could likely be used though I did't pursue that angle.
comment:15 by , 16 years ago
Replying to warmerdam:
Normand,
I found that wget sends the Content-type of posts as application/x-www-form-urlencoded which interferes with it being recognised as a XML post request. It could be anything else, but according to the standard I assume it is supposed to be something like text/xml.
Based on this I wasn't able to text with wget, and had to use a little web app Tom had that sets the content type properly. Other tools (perhaps curl or python http posting) could likely be used though I did't pursue that angle.
Frank: I'll assume it is fixed then. Thanks.
Looks like we don't support XML POST requests in mapwcs.c. This can be implemented in the same way mapwfs.c or mapogcsos.c are (though mapwcs.c uses CPL and mapogcsos.c uses libxml2 to parse the XML document).