Trong khi gọi một webservice được lưu trữ trong một máy chủ từ một trang aspx nhận được lỗi như "Yêu cầu không thành công với một phản hồi trống"."Yêu cầu không thành công với một phản hồi trống" khi gọi một dịch vụ web
mã trong trang của tôi
try {
HttpWebRequest request1 = (HttpWebRequest)WebRequest.Create("https://login.erp.com/rodeprovisioning/provisioning.asmx");
request1.Accept = "text/xml";
request1.Method = "POST";
WebProxy proxyObject = new System.Net.WebProxy("http://10.0.0.1:8080/", true);
request1.Proxy.Credentials = CredentialCache.DefaultCredentials;
string sReturnValue = null;
if (string.IsNullOrEmpty(Session["Test"])) {
sReturnValue = callservice();
if (sReturnValue == "Success") {
ErrorLabel.Text = sReturnValue;
Session["Test"] = "True";
} else {
ErrorLabel.Text = sReturnValue;
}
}
} catch (Exception ex) {
}
và trong web.config
<system.net>
<authenticationModules>
<add type = "System.Net.DigestClient" />
<add type = "System.Net.NegotiateClient" />
<add type = "System.Net.KerberosClient" />
<add type = "System.Net.NtlmClient" />
<add type = "System.Net.BasicClient" />
</authenticationModules>
<connectionManagement>
<add address = "*" maxconnection = "2" />
</connectionManagement>
<defaultProxy>
<proxy usesystemdefault="True" bypassonlocal = "True" />
</defaultProxy>
<webRequestModules>
<add prefix = "http" type = "System.Net.HttpRequestCreator" />
<add prefix = "https" type = "System.Net.HttpRequestCreator" />
<add prefix = "file" type = "System.Net.FileWebRequestCreator" />
</webRequestModules>
</system.net>
Có một bức tường lửa problem.Any Đề xuất?
Bạn đã thử sử dụng Wireshark để tìm hiểu điều gì đang xảy ra ở cấp HTTP không? –
Không jon i havent ... – bala3569
Sau đó, tôi đề nghị đó nên là bước tiếp theo của bạn. Không có vấn đề gì trong việc cố gỡ lỗi máy khách nếu đó là vấn đề phía máy chủ hoặc ngược lại. –