cancel
Showing results for 
Search instead for 
Did you mean: 

send a xml file to another URL

iguanna
Champ in-the-making
Champ in-the-making
hi all,

Could you help me out with this issue? I need to send a xml file to another URL. I know how to build the xml file and I know the url, but how do I send it by post calling from Alfresco?

thanks
2 REPLIES 2

hsohaib
Champ on-the-rise
Champ on-the-rise
this is more a java question, to post data to an url  code :


String xml = "Your xml here";
HttpURLConnection connection =  new HttpURLConnection("http://www.yoururl.com");
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "text/xml; charset=\"utf-8\"");
connection.setDoOutput(true);
connection.OutputStreamWriter out = new OutputStreamWriter(c.getOutputStream(),
"UTF8");
out.write(xml);
out.close();

iguanna
Champ in-the-making
Champ in-the-making
that's true, it's more a java question, sorry I didn't realize. Anyway thank you for your answer.