Skip to main content
Question

Using httpcaller to update a Geoserver WMS

  • November 19, 2018
  • 5 replies
  • 117 views

Forum|alt.badge.img

Hi,

I have a Geoserver time enabled WMS that's been created using the Imagemosaic plugin. The only way add and remove granules is to use the Geoserver API.

 

httpcaller works great for a GET request to list the granules but I'm having issues structuring the httpcaller to use POST to Harvest a single granule into the imagemosaic.

Anyone done something similar and know how this could be achieved?

Many thanks!

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • November 19, 2018

Never tried but looks doable. I don't have a GeoServer running so I can't test / build it. I would start with PostMan and when it works there transfer it to the HTTPCaller.


Forum|alt.badge.img
  • Author
  • 5 replies
  • November 20, 2018

Never tried but looks doable. I don't have a GeoServer running so I can't test / build it. I would start with PostMan and when it works there transfer it to the HTTPCaller.

Thanks, will try that out and let you know


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • November 20, 2018

Thanks, will try that out and let you know

Let me know if you need any pointers, not sure what your skill level is so excuses me if I guessed wrong. What works well for starters is to try to get as simple POST request working in PostMan (ArcGIS Server API Documentation has some usable endpoints to try acquire a token over Post.) and then transfer this to the HTTPCaller.


mark2atsafe
Safer
Forum|alt.badge.img+56
  • Safer
  • 2554 replies
  • November 20, 2018

I suspect put the URL in the Request URL field, eg:

"http://localhost:8080/geoserver/rest/workspaces/topp/coveragestores/poly-incremental/external.imagemosaic"

Set HTTP Method to POST, set Body:Upload Data to Upload from File, select the file in Body:Upload File, and set the Body:Content Type to Text (text/plain).

See what that returns. You may have to turn on Authentication and, depending on the method, it might form part of the headers (I'm thinking if you have to provide a token, that's where it would go).

The other thing I can suggest is to turn on Tools > FME Options > Translation > Log Debug. Usually I wouldn't recommend that, as it can throw up some weird messages that aren't as bad as they sound, but for HTTP calls you can get a bit more detailed logging with that option turned on, which makes it worth it.

And yes, as @nielsgerrits says, PostMan is a pretty good tool that I know some of our folk use for testing out API calls.


Forum|alt.badge.img
  • Author
  • 5 replies
  • December 6, 2018

I suspect put the URL in the Request URL field, eg:

"http://localhost:8080/geoserver/rest/workspaces/topp/coveragestores/poly-incremental/external.imagemosaic"

Set HTTP Method to POST, set Body:Upload Data to Upload from File, select the file in Body:Upload File, and set the Body:Content Type to Text (text/plain).

See what that returns. You may have to turn on Authentication and, depending on the method, it might form part of the headers (I'm thinking if you have to provide a token, that's where it would go).

The other thing I can suggest is to turn on Tools > FME Options > Translation > Log Debug. Usually I wouldn't recommend that, as it can throw up some weird messages that aren't as bad as they sound, but for HTTP calls you can get a bit more detailed logging with that option turned on, which makes it worth it.

And yes, as @nielsgerrits says, PostMan is a pretty good tool that I know some of our folk use for testing out API calls.

Thanks @Mark2AtSafe and @nielsgerrits, PostMan worked a treat to help get the call correct.  Thanks for you help!