POST /soap/rpc HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50113.0) Authorization: Basic bGRwcm86Rwcm8=
Content-Type: text/xml; charset=utf-8
SOAPAction: "TEST"
Host: spo-wm-py-srvr:5555
Content-Length: 779
Expect: 100-continue
Accept-Encoding: gzip
ผม add web reference จาก wsdl ไฟล์มาแล้ว และได้ method ของ web service
นี่คือ โค้ด ที่ผมเขียนครับ
Service1.Service service = new Service1.Service();
NetworkCredential netCredential = new NetworkCredential("username", "password")
Uri uri = new Uri(service.Url);
ICredentials credentials = netCredential.GetCredential(uri, "Basic");
service.Credentials = credentials;
service.PreAuthenticate = true;
service.Method();
แต่มันขึ้นเออเร่อว่า The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.