cancel
Showing results for 
Search instead for 
Did you mean: 

Web Client post xml data

hansg
Explorer
2,993

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

Accepted Solutions (0)

Answers (1)

Answers (1)

hansg
Explorer

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>')
VolkerBarth
Contributor
0 Kudos

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"...