Вот собственно код библиотеки:
Код: Выделить всё
using System;
using System.Configuration;
using System.Data;
using System.Net;
using System.Linq;
using System.Web;
using System.Security;
using System.Xml.Linq;
using System.Xml;
using System.IO;
using System.Text;
namespace UnderMain
{
public static class Request
{
public static void Responce()
{
var pass = "Password";
var code = System.Security.Cryptography.MD5.Create(pass);
var rhcp = System.Security.Cryptography.SHA1.Create(code.ToString());
var url = "https://website.com";
var postData = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <request version=\"1.0\"> <merchant><id>i123</id> <signature>" + rhcp + "</signature> </merchant><data><oper>prp</oper></data> </request>";
var bytes = System.Text.Encoding.ASCII.GetBytes(postData);
var req = (HttpWebRequest)WebRequest.Create(url);
req.ContentType = "text/xml";
req.Method = "POST";
req.ContentLength = bytes.Length;
using (var os = req.GetRequestStream())
{
os.Write(bytes, 0, bytes.Length);
}
string response = "";
using (var resp = req.GetResponse())
{
using (var sr = new StreamReader(resp.GetResponseStream()))
{
response = sr.ReadToEnd().Trim();
}
}
}
}
}
Кто что может подсказать?