由于客户的web service接口从 http 变为 https, 导致visual studio之间添加 web reference报错,无法访问。
现改成了HttpWebRequest 调用方式。
客户的 SOAP 1.2 请求格式如下:
POST /xxx/Tradechange.asmx HTTP/1.1
Host: www.demo.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/Save"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Save xmlns="http://tempuri.org/">
<tradeChange>string</tradeChange>
<valiKey>string</valiKey>
</Save>
</soap:Body>
</soap:Envelope>
C# 调用代码如下:
using System;
using System.IO;
using System.Net;
using System.Text;
namespace SyncData.Utils
{
public class SOAPHelper
{
/// <summary>