Skip to main content
Question

Using httpcaller to update a Geoserver WMS

  • November 19, 2018
  • 5 replies
  • 79 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!

 

5 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

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
  • November 20, 2018
nielsgerrits wrote:

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+54
sirrona wrote:

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+44
  • Safer
  • 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
  • December 6, 2018
mark2atsafe wrote:

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!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings