I need to invoke a web service and extract what I need from the response using a combination of curl and xsltproc. However, any file-based parameters that must be supplied to both these programs must be from stdin and not actual files.
At least with curl, it seems to think that I am supplying a file with the "--data @" parameter, while what I am actually doing is supplying the contents of the expected file via standard input (by placing a hyphen next to the @ symbol). With xsltproc, it is a little more tricky because the syntax is...
If I used the same trick to supply the XML-file contents to xsltproc via stdin, that works (see below):
...but I don't know how to specify the stylesheet via stdin.
Below are all the relevant details.
The following Bash script sends a SOAP request via curl. holidayrequest.sh
The following [sample] SOAP response is received by stdout (formatted for clarity): (I saved the above response to output.xml and transformed it using an XSLT stylesheet remove-soap-envelope.xslt and xsltproc; "Approved" prints to stdout.)
remove-soap-envelope.xslt
A push in the right direction will be much appreciated!
Thanks.
Ashwin
Last edited by webuser; 07-16-2011 at 12:10 AM..
Reason: incorrect code
I don't want to maintain a separate file for the stylesheet, if I can help it. And the stylesheet I posted works -- this is straight from working code.
Hi
I need to get rates for different security form REST API . the API is oauth 2.0 secured.
i need to use curl command to get json response from api .
token URL - is HTTP
data URL is - HTTPS
when trigger my command from bash script it passing and failing intermittently with... (0 Replies)
Hello, Newbie here,
I have a perfectly well working web service call I can issue from chrome (PC Windows 10) and get the results I want (a dimmer being turned on in Fibaro Home Center 2 at level 40)
I am not allowed to post urls but the below works with http and :// and... (3 Replies)
Hello dears,
I am trying to log in the website using curl but no luck so far.
The web page Content-Type is : text/html;charset=ISO-8859-1
I try the following command using curl:
curl \
--header "Content-type: text/html" \
--request POST \
--data '{"user": "someusername",... (0 Replies)
Hello,
I'm new in the forum and really beginer, and also sorry form my bad english.
I use linux and want to create little program to download automaticaly some pdf (invoices) and put in a folder of my computer. I learn how to do and programme with ubuntu but the program will be implemented... (1 Reply)
Hi,
For one of our requirements, we are using curl command from a Linux box to call the servlet using PEM certificates type. Once servlet is trigger, the data will be loaded through servlet. If the servlet thread is completed successfully, then the control should return to Unix and based on... (0 Replies)
Hi,
I would like to call the below perl web service from javascript .Any help would be appreciated.I am new to web services.Please do the needful.
Server Program(Perl Web Service)
#!/usr/bin/perl
use lib '/usr/lib/perl5/5.8.8/SOAP-Lite-0.65_3/lib';
use SOAP::Transport::HTTP;
use Demo;... (3 Replies)
Hello All,
I have to import data from xml file to mysql database multi-time a day. I think it is better to write a tool to help this. So I write a web service in php. I don't know that if we can call a web service via shell script. If it can, I think we can create a cron job to help run it... (2 Replies)
I can't quite seem to understand what the curl command does with a web address. I tried this:
curl O'Reilly Media: Tech Books, Conferences, Courses, News
but I just got the first few lines of a web page, and it's nowhere on my machine. Can someone elaborate? (2 Replies)
Hello to all,
What i would like to know is how to call a web service using perl.
Where can i find documentation that easy describes this procedure?
Any advices will be more tha welcome.
Thank you.
Best Regards,
Chriss_58 (3 Replies)
I'm a Unix and C programming newbie, and I've been tasked with calling a web service from a legacy Unix app... I've come across libxml2 and libsoup, gnome's libraries for XML/SOAP processing... But I'm seeking guidance on the development process... :o (0 Replies)