Ticket #3302 (closed feature: fixed)

Opened 2 years ago

Last modified 2 years ago

Post URL for GetMap request in WMSCapabilities Format

Reported by: jachym Owned by: tschaub
Priority: major Milestone: 2.11 Release
Component: Format.WMSCapabilities Version: 2.10
Keywords: WMS, Post, Get Cc:
State: Review

Description

When I call some WMS service for GetCapabilities (e.g.  http://portal.ingr.briseide.eu/CCSS_MAP_WMS/wmservice.aspx) and as result, I get

...
<GetMap>
<Format>image/png</Format>
<Format>image/jpeg</Format>
<Format>image/svg+xml</Format>
  <DCPType>
    <HTTP>
      <wms:Get>
        <wms:OnlineResource xlink:href="http://portal.ingr.briseide.eu/CCSS_MAP_WMS/service.svc/get?" xlink:type="simple"/>
      </wms:Get>
      <wms:Post>
        <wms:OnlineResource xlink:href="http://portal.ingr.briseide.eu/CCSS_MAP_WMS/service.svc/post" xlink:type="simple"/>
      </wms:Post>
     </HTTP>
   </DCPType>
</GetMap>
...

And let it parse with OpenLayers.Format.WMSCapabilities,

getmap: 
    formats: Array[3]
    href: "http://portal.ingr.briseide.eu/CCSS_MAP_WMS/service.svc/post"

resulting object has only one 'href' attribute

capability.request.getmap.href

Which corresponds to the URL taken from the Post node (which is parsed later, than the Get node).

This patch will modify the capability.request.getmap object, so it takes two new attributes, post and get, both with href attribute.

At the and, capability.requeyst.getmap.href will always get URL from the Get node. Result

getmap: 
    formats: Array[3]
    get: 
      href: "http://portal.ingr.briseide.eu/CCSS_MAP_WMS/service.svc/get?"
    href: "http://portal.ingr.briseide.eu/CCSS_MAP_WMS/service.svc/get?"
    post: 
      href: "http://portal.ingr.briseide.eu/CCSS_MAP_WMS/service.svc/post"

Attachments

WMSCapabilities.v1.js.patch Download (1.4 KB) - added by jachym 2 years ago.
test.WMSCapabilities.v1_1_1.html.patch Download (1.6 KB) - added by jachym 2 years ago.

Change History

Changed 2 years ago by jachym

  Changed 2 years ago by bartvde

see also #3275 which I have just closed as a duplicate

  Changed 2 years ago by ahocevar

  • milestone changed from 2.11 Release to 2.12 Release

@jachym: thanks for this great improvement. Unfortunately I have to set the milestone to 2.12, because we will be starting the 2.11 release process today. If you can add a unit test in the next 2-3 hours and set the ticket state to Review, I can finish my review and commit the patch, and it can be in 2.11. Otherwise it will be in 2.12.

  Changed 2 years ago by jachym

  • state set to Review
  • milestone changed from 2.12 Release to 2.11 Release

Well, very quick test attached

Changed 2 years ago by jachym

follow-up: ↓ 7   Changed 2 years ago by ahocevar

  • state changed from Review to Needs More Work
  • milestone changed from 2.11 Release to 2.12 Release

Tests fail in Safari5:

test_read planned 17 assertions but got 3; fail 0 ok 3
exception: : object: Result of expression 'getmap.get' [undefined] is not an object.
ok object contains capability property
ok getmap formats parsed
ok getmap href parsed

If you can fix this fast, there's still a chance for 2.11.

  Changed 2 years ago by ahocevar

  • state changed from Needs More Work to Review
  • milestone changed from 2.12 Release to 2.11 Release

oh sorry, I just applied the test patch.

  Changed 2 years ago by ahocevar

  • status changed from new to closed
  • resolution set to fixed

(In [11978]) returning Get and Post OnlineResources separately, in addition to the existing href, which is now for get. p=jachym, r=me (closes #3302)

in reply to: ↑ 4   Changed 2 years ago by jachym

Replying to ahocevar:

Tests fail in Safari5: {{{ test_read planned 17 assertions but got 3; fail 0 ok 3 exception: : object: Result of expression 'getmap.get' [undefined] is not an object. ok object contains capability property ok getmap formats parsed ok getmap href parsed }}} If you can fix this fast, there's still a chance for 2.11.

Very strange - I'm using chrome, should be the same?

Anyway, I hope, I did not break something?

  Changed 2 years ago by ahocevar

No worries, you did not break anything. The test failed without the lib patch applied, and passed with the patch applied. Perfect, and already in with r11978.

  Changed 2 years ago by marcjansen

Revision [11979] corrects a minor typo introduced in [11978]

Note: See TracTickets for help on using tickets.