diff --git a/lib/OpenLayers/Format/OWSCommon/v1.js b/lib/OpenLayers/Format/OWSCommon/v1.js index 0202dc2277..00f4e2b91b 100644 --- a/lib/OpenLayers/Format/OWSCommon/v1.js +++ b/lib/OpenLayers/Format/OWSCommon/v1.js @@ -171,24 +171,24 @@ OpenLayers.Format.OWSCommon.v1 = OpenLayers.Class(OpenLayers.Format.XML, { this.readChildNodes(node, dcp.http); }, "Get": function(node, http) { - http.get = this.getAttributeNS(node, - this.namespaces.xlink, "href"); - if (!http.constraints) { - http.constraints = {}; + if (!http.get) { + http.get = []; } - var obj = {}; + var obj = { + url: this.getAttributeNS(node, this.namespaces.xlink, "href") + }; this.readChildNodes(node, obj); - http.constraints.get = obj.constraints; + http.get.push(obj); }, "Post": function(node, http) { - http.post = this.getAttributeNS(node, - this.namespaces.xlink, "href"); - if (!http.constraints) { - http.constraints = {}; + if (!http.post) { + http.post = []; } - var obj = {}; + var obj = { + url: this.getAttributeNS(node, this.namespaces.xlink, "href") + }; this.readChildNodes(node, obj); - http.constraints.post = obj.constraints; + http.post.push(obj); }, "Parameter": function(node, operation) { if (!operation.parameters) { diff --git a/tests/Format/OWSCommon/v1_1_0.html b/tests/Format/OWSCommon/v1_1_0.html index e899ea8486..1cdf7ee281 100644 --- a/tests/Format/OWSCommon/v1_1_0.html +++ b/tests/Format/OWSCommon/v1_1_0.html @@ -6,7 +6,7 @@ function test_read_exception(t) { t.plan(6); var text = '' + -'' + ' ' + @@ -18,7 +18,7 @@ var format = new OpenLayers.Format.OWSCommon(); var result = format.read(text); var report = result.exceptionReport; - t.eq(report.version, "1.0.0", "Version parsed correctly"); + t.eq(report.version, "1.1.0", "Version parsed correctly"); t.eq(report.language, "en", "Language parsed correctly"); var exception = report.exceptions[0]; t.eq(exception.code, "InvalidParameterValue", "exceptionCode properly parsed"); diff --git a/tests/Format/SOSCapabilities/v1_0_0.html b/tests/Format/SOSCapabilities/v1_0_0.html index ed7f25eb65..6713685903 100644 --- a/tests/Format/SOSCapabilities/v1_0_0.html +++ b/tests/Format/SOSCapabilities/v1_0_0.html @@ -40,7 +40,7 @@ t.eq(obj.serviceProvider.serviceContact.contactInfo.phone.voice, "+49-251-83-30088", "Voice phone correctly parsed"); // operationsMetadata (from OWSCommon) - t.eq(obj.operationsMetadata.DescribeSensor.dcp.http.post, "http://v-swe.uni-muenster.de:8080/WeatherSOS/sos", "POST url for DescribeSensor correctly parsed"); + t.eq(obj.operationsMetadata.DescribeSensor.dcp.http.post[0].url, "http://v-swe.uni-muenster.de:8080/WeatherSOS/sos", "POST url for DescribeSensor correctly parsed"); var counter = 0; for (var key in obj.operationsMetadata.DescribeSensor.parameters.procedure.allowedValues) { if (counter == 0) { diff --git a/tests/Format/WMTSCapabilities/v1_0_0.html b/tests/Format/WMTSCapabilities/v1_0_0.html index ff30f51998..f8b5a37215 100644 --- a/tests/Format/WMTSCapabilities/v1_0_0.html +++ b/tests/Format/WMTSCapabilities/v1_0_0.html @@ -30,16 +30,16 @@ // ows:OperationsMetadata var operationsMetadata = obj.operationsMetadata; - t.eq(operationsMetadata.GetCapabilities.dcp.http.get, "http://www.miramon.uab.es/cgi-bin/MiraMon5_0.cgi?", "ows:OperationsMetadata GetCapabilities url is correct"); - t.eq(operationsMetadata.GetCapabilities.dcp.http.constraints.get.GetEncoding.allowedValues, + t.eq(operationsMetadata.GetCapabilities.dcp.http.get[0].url, "http://www.miramon.uab.es/cgi-bin/MiraMon5_0.cgi?", "ows:OperationsMetadata GetCapabilities url is correct"); + t.eq(operationsMetadata.GetCapabilities.dcp.http.get[0].constraints.GetEncoding.allowedValues, {'KVP': true}, "ows:OperationsMetadata GetCapabilities Constraints Get is correct"); - t.eq(operationsMetadata.GetFeatureInfo.dcp.http.get, "http://www.miramon.uab.es/cgi-bin/MiraMon5_0.cgi?", "ows:OperationsMetadata GetFeatureInfo url is correct"); - t.eq(operationsMetadata.GetFeatureInfo.dcp.http.constraints.get, + t.eq(operationsMetadata.GetFeatureInfo.dcp.http.get[0].url, "http://www.miramon.uab.es/cgi-bin/MiraMon5_0.cgi?", "ows:OperationsMetadata GetFeatureInfo url is correct"); + t.eq(operationsMetadata.GetFeatureInfo.dcp.http.get[0].constraints, undefined, "ows:OperationsMetadata GetFeatureInfo Constraints Get is correct"); - t.eq(operationsMetadata.GetTile.dcp.http.get, "http://www.miramon.uab.es/cgi-bin/MiraMon5_0.cgi?", "ows:OperationsMetadata GetTile url is correct"); - t.eq(operationsMetadata.GetTile.dcp.http.constraints.get, + t.eq(operationsMetadata.GetTile.dcp.http.get[0].url, "http://www.miramon.uab.es/cgi-bin/MiraMon5_0.cgi?", "ows:OperationsMetadata GetTile url is correct"); + t.eq(operationsMetadata.GetTile.dcp.http.get[0].constraints, undefined, "ows:OperationsMetadata GetTile Constraints Get is correct"); } @@ -56,7 +56,7 @@ t.eq(numOfLayers, 1, "correct count of layers"); var layer = contents.layers[0]; - t.eq(layer.abstract, "Coastline/shorelines (BA010)", "layer abstract is correct"); + t.eq(layer['abstract'], "Coastline/shorelines (BA010)", "layer abstract is correct"); t.eq(layer.identifier, "coastlines", "layer identifier is correct"); t.eq(layer.title, "Coastlines", "layer title is correct"); @@ -99,7 +99,7 @@ var dimensions = layer.dimensions; t.eq(dimensions.length, 1, "correct count of dimensions"); t.eq(dimensions[0].title, "Time", "first dimension title is correct"); - t.eq(dimensions[0].abstract, "Monthly datasets", "first dimension abstract is correct"); + t.eq(dimensions[0]['abstract'], "Monthly datasets", "first dimension abstract is correct"); t.eq(dimensions[0].identifier, "TIME", "first dimension identifier is correct"); t.eq(dimensions[0]['default'], "default", "first dimension default is correct"); t.eq(dimensions[0].values.length, 3, "first dimension has correct count of values");