SOAP リクエストを生成しようとしていますが、何が間違っているのかわかりません ...
リクエストがどのように表示されるかについてのドキュメントは次のとおりです: http://wiki.affiliatewindow.com/index.php/Affiliate_Service_API_v4
そして、これが私がやったことです:
StringBuilder reqBuilder = new StringBuilder(1000);
reqBuilder.Append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:ns1=\"http://api.affiliatewindow.com/\">");
reqBuilder.Append("<soapenv:Header>");
reqBuilder.Append("<ns1:UserAuthentication soapenv:mustUnderstand=\"1\" soapenv:actor=\"http://api.affiliatewindow.com\">");
reqBuilder.Append("<ns1:iId>***********</ns1:iId>");
reqBuilder.Append("<ns1:sPassword>**************</ns1:sPassword>");
reqBuilder.Append("<ns1:sType>affiliate</ns1:sType>");
reqBuilder.Append("</ns1:UserAuthentication>");
reqBuilder.Append("</soapenv:Header>");
reqBuilder.Append("<soapenv:Body>");
reqBuilder.Append("<ns1:getTransactionList>");
reqBuilder.Append("<ns1:dStartDate>" + dateTimePickerFrom.Value.ToString("yyyy-MM-dd")+ "</ns1:dStartDate>");
reqBuilder.Append("<ns1:dEndDate>" + dateTimePickerTo.Value.ToString("yyyy-MM-dd") + "</ns1:dEndDate>");
reqBuilder.Append("<ns1:sDateType>transaction</ns1:sDateType>");
reqBuilder.Append("</ns1:getTransactionList>");
reqBuilder.Append("</soapenv:Body>");
reqBuilder.Append("</soapenv:Envelope>");
string strSoapMessage = reqBuilder.ToString();
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(new Uri(@"http://api.affiliatewindow.com/v4/AffiliateService?wsdl"));
req.ContentType = "text/xml; charset=utf-8";
req.Method = "POST";
req.Accept = "text/xml";
req.Headers.Add("SOAPAction", "getTransactionList");
byte[] reqBytes = System.Text.Encoding.UTF8.GetBytes(strSoapMessage);
req.ContentLength = reqBytes.Length;
Stream reqStream = req.GetRequestStream();
reqStream.Write(reqBytes, 0, reqBytes.Length); reqStream.Close();
HttpWebResponse response = req.GetResponse() as HttpWebResponse;
Stream responsedata = response.GetResponseStream();
StreamReader responsereader = new StreamReader(responsedata);
string response1 = responsereader.ReadToEnd();
string saveFileName = "test.xml";
XmlDocument xmlFile = new XmlDocument();
xmlFile.LoadXml(response1);
xmlFile.Save(saveFileName);
私の応答は wsdl サービスの内容です ( http://api.affiliatewindow.com/v4/AffiliateService?wsdl )
どんな助けでも大歓迎です