Skip to main content
Question

curl to HTTP caller

  • February 25, 2025
  • 3 replies
  • 64 views

g.bizournet
Contributor
Forum|alt.badge.img+1

 

 
 how can i turn this in FME????
 
 login and get cookie:
 curl -k -i -X POST -d j_username=xxx -d j_password=xx -c cookies.txt https://<host>/Webcontrols/xmlsql

 login with cookie:
 curl -k -i -X POST -d j_username=xxx -d j_password=xx -b cookies.txt  https://<host>/Webcontrols/j_security_check
 echo "Get data from iprotect"

query results to get data:
curl -k -X POST -d @$base_dir/sql/acceskey.xml -b cookies.txt https://<host>/Webcontrols/xmlsql  --output acceskey_iprotect.xml

in the acceskey.xml is an xml format query select * from <table>

output gives the data in xml format
 

3 replies

g.bizournet
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • February 26, 2025

Nobody???


philippeb
Enthusiast
Forum|alt.badge.img+18
  • Enthusiast
  • February 26, 2025

HTTPCaller will be your friend on this

Everything you need will be there.


oliver
Contributor
Forum|alt.badge.img+6
  • Contributor
  • February 27, 2025

Hi ​@g.bizournet!

I don't really understand what the second step is for?
Does it start some kind of processing, the result of which is picked up in step three?

And do you really have to upload the cookie even though you log in with user and password?

 

I agree with ​@philippeb : the HTTPCaller should have everything you need.

Let's look at the details.

-c, --cookie-jar <filename>, write cookie to file
-b, --cookie <data|filename>, read cookie from file
-k, --insecure
-X, --request <method>, POST
-d, --data <data>
 

Up-/download body from/to file

Regarding authentication:

Either try basic authentication

basic auth

Or put your j_username and j_password into http header:

 

And for “-k” switch and cookie-handling try

 

A few additional thoughts:

If your acceskey.xml is dynamic, i.e. the content changes, think about using the XMLTemplater-Transformer to feed the XML dynamically (pre-processing). Put the XML into an attribute, not a file.

The same for the post-processing: write the response into an attribute, not a file, and process the output using FME’s XML-tools like XMLFlattener or XMLFragmenter.

 

Many success!

Oliver


Reply


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