K
K
kir_cipher2016-11-14 20:39:43
SOAP
kir_cipher, 2016-11-14 20:39:43

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;
        }

(WSDL - the link specified in the documentation of the payment system I need )
Compiling the requests themselves is no problem. And how to send them correctly is not clear. The server keeps returning the 500th error. Help, who than can, please!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Nemiro, 2016-11-14
@kir_cipher

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 и что требуется для их использования
// могут быть и другие подводные камни и особенности,
// но свой код взаимодействия писать не придется
// для большинства случаев достаточно будет автоматически созданных классов

D
desi24, 2019-10-30
@desi24

I have one problem5db9bb6a9ba98737887739.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question