Answer the question
In order to leave comments, you need to log in
What is wrong with my SOAP request?
I create a request in C# with the following code
public void SOAP2()
{
string postData = File.ReadAllText("GetInfo.xml", Encoding.UTF8).Replace("\n", " ");
WebRequest request = WebRequest.Create("https://tracking.russianpost.ru/rtm34?wsdl");
request.ContentType = "text/xml;charset=\"utf-8\"";
request.Method = "POST";
StreamWriter sw = new StreamWriter(request.GetRequestStream());
sw.WriteLine(postData);
sw.Close();
WebResponse response = request.GetResponse();
XDocument loaded = XDocument.Load(response.GetResponseStream());
richTextBox1.Text = loaded.ToString();
//// разбираем ответ
loaded.Save("GetInfo2.xml");
}
<?xml version="1.0" encoding="utf-8"?>
<head>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:oper="http://russianpost.org/operationhistory" xmlns:data="http://russianpost.org/operationhistory/data" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<oper:getOperationHistory>
<!--Optional:-->
<data:OperationHistoryRequest>
<data:Barcode>18501634020406</data:Barcode>
<data:MessageType>0</data:MessageType>
<!--Optional:-->
<data:Language>RUS</data:Language>
</data:OperationHistoryRequest>
<!--Optional:-->
<data:AuthorizationHeader soapenv:mustUnderstand="?">
<data:login>login</data:login>
<data:password>pass</data:password>
</data:AuthorizationHeader>
</oper:getOperationHistory>
</soap:Body>
</soap:Envelope>
</head>
Answer the question
In order to leave comments, you need to log in
So you make a request to receive a WSDL file ( https://tracking.russianpost.ru/rtm34?wsdl) and you get it.
On the page https://tracking.pochta.ru/specification, it is indicated that the address of the service is https://tracking.russianpost.ru/rtm34
Yes, and the request should be without an xml header and a strange head tag, that is, it should start with soap: Envelope
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question