Question

Using httpcaller to update a Geoserver WMS

  • 19 November 2018
  • 5 replies
  • 9 views

Badge

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!

 


5 replies

Userlevel 6
Badge +31

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.

Badge

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

Userlevel 6
Badge +31

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.

Userlevel 4
Badge +25

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.

Badge

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!

Reply