Код: Выделить всё
WebClient httpClient = new WebClient();
httpClient.Credentials = new NetworkCredential("username", "password");
httpClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
// Build resourceDescriptor
string requestXml;
requestXml = "";
requestXml += "
1016242n";
requestXml += "";
// Send PUT, the requestAllResult contains the above ...
string requestAllResult = httpClient.UploadString("http://SRV9:8080/jasperserver/rest/report/reports/NOSreports/Invoice?RUN_OUTPUT_FORMAT=PDF", "PUT", requestXml);
// Extract uuid and file
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(requestAllResult);
XmlNode node = doc.DocumentElement.SelectSingleNode("uuid");
string uuid = node.InnerText;
//Build GET URL
string reportUrl = "http://SRV9:8080/jasperserver/rest/resources/report/";
reportUrl += uuid;
reportUrl += "?file=report";
// Get report
string report;
report = httpClient.DownloadString(reportUrl);
Подробнее здесь: https://stackoverflow.com/questions/232 ... rp-asp-net