Hi使用C#发送Http请求的最佳做法是什么,将许多参数传递给SOAP端点。我还要求在请求中添加几个标题。
我将SOAP API定义为
<soapenv:Envelope xmlns:soapenv="schemas.xmlsoap.org/soap/envelope/" ; xmlns:mac="iib.macinfra.in/mac">;
<soapenv:Header>
<mac:RequestHeader>
<mac:Id>GFyZxV0</mac:ApplicationId>
<mac:MessageId>pfoshdttc</mac:MessageId>
</mac:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<mac:FindMailRequest>
<mac:QueryString>CM7JT</mac:QueryString>
</mac:FindMailRequest>
</soapenv:Body>
</soapenv:Envelope>
我想构建HttpRequest
并使用HttpWebRequest webreq = WebRequest.Create(webserviceUrl) as HttpWebRequest;