Can I consume a Restful web service that needs to post a XML file? I like to call a Redmine web service to register hours for a project. I need to call a web service described in this url: http://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries How do I pass the needed XML string to the web service? Tia Hans |
I solved the problem as follows. Maybe somebody else can us this in the future. CREATE PROCEDURE "DBA"."zz_redmine_test"(IN "time_entries.xml" LONG VARCHAR) URL 'https://bb<--My API key-->>ca:pwd@pj.tsd.nl:1443/redmine/time_entries.xml' CERTIFICATE 'CERT=-----BEGIN CERTIFICATE----- MIIE7zCCA9egAwIBAgIQJYaVVWDj...... ...... -----END CERTIFICATE-----' TYPE 'HTTP:POST:text/xml' CALL "DBA"."zz_redmine_test" ('<time_entry> <issue_id>1139</issue_id> <activity_id>9</activity_id> <hours>1.0</hours> <comments>Testfall</comments> <spent_on>2012-02-16</spent_on> </time_entry>') Glad you got it working! Apparently, you could use SQL Anywhere's XML features / XML datatype to construct the XML object instead of building it "manually"...
(18 Feb '14, 09:18)
Volker Barth
|
Would you please explain how your question is related to SQL Anywhere (that's what this forum is about)?
I like to call a web service with SQL Anywhere, to send data from our database to Redmine. In a way like this: CREATE PROCEDURE "DBA"."zz_redmine_test"(IN as_xml XML) URL 'http://xxxx:yyyy@pj.tsd.nl:1443/redmine/time_entries.xml' TYPE 'HTTP:POST'
I used that for retrieving Google Maps locations and other web sites also. But now I have to Post a web service that needs a set of XML data.
Have you had a look at that doc page on web client functions and POST requests:
Web service request types
Yes I did. But I do know how to call a service of Redmine, see my original post. I need to create time entries an therfore need to Post a time_entries.xml. No idea if is possible with SA..?