Answer the question
In order to leave comments, you need to log in
What is the correct way to send soap requests using C# (especially to AdvCash servers)?
Hello dear friends!
I had never dealt with soap requests before, so they put me in a kind of panic state. I am using this code:
private XmlDocument SendSoap(string xml)
{
WebRequest request = WebRequest.Create(WSDL);
request.ContentType = "text/xml;charset=\"utf-8\"";
request.Method = "POST";
string postData = xml;
StreamWriter sw = new StreamWriter(request.GetRequestStream());
sw.WriteLine(postData);
sw.Close();
WebResponse response = request.GetResponse();
XmlDocument loaded = new XmlDocument();
loaded.Load(response.GetResponseStream());
return loaded;
}
Answer the question
In order to leave comments, you need to log in
Usually it's done like this:
Link to the service: https://wallet.advcash.com:8443/wsm/merchantWebSer...
And then it's code :-)
// ServiceReference1 - см. на картинке выше, можно указать любое имя
var client = new ServiceReference1.MerchantWebServiceClient();
// и смотрите какие есть методы в client и что требуется для их использования
// могут быть и другие подводные камни и особенности,
// но свой код взаимодействия писать не придется
// для большинства случаев достаточно будет автоматически созданных классов
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question