c# - "Fiddler has detected a protocol violation in session. Content-Length mismatch"

标签 c# web-services

Fiddler 在 session 中检测到协议(protocol)违规。内容长度不匹配:响应 header 要求 292 字节,但服务器发送了 293 字节。

由于返回的响应大小,每次调用网络服务时都会出错。我可以访问这两个网络服务 ( http://gator1122.hostgator.com/~soptions/demo/administrator/components/com_vm_soa/services/VM_CategoriesService.php?WSDL )

当我使用以下代码添加产品时(我意识到密码正在显示,这没关系,因为它是一个演示数据库)。

VM_Categories_ws.VM_Categories proxy = new VM_Categories_ws.VM_Categories();

VM_Categories_ws.loginInfo logindetails = new VM_Categories_ws.loginInfo();
logindetails.login = "admin";
logindetails.password = "password";

VM_Categories_ws.AddCategoryInput categoryInput = new VM_Categories_ws.AddCategoryInput();

category.name= "13";
category.description = "test";
category.category_flypage = null;
category.category_browsepage = "browse_1";
category.category_publish = "Y";

categoryInput.loginInfo = logindetails;
categoryInput.category = category;
proxy.AddCategory(categoryInput);

我可以访问网络服务和 C# 客户端,但无法让它们一起工作。

最佳答案

这可能是因为发送的是“\r\n”而不是“\n”。一个额外的字节是不可打印的字符。

关于c# - "Fiddler has detected a protocol violation in session. Content-Length mismatch",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3234110/

相关文章:

java - 无法在 html 请求中下载大文件

c# - 无法使用 C# 驱动程序过滤 MongoDB 中的日期字段

java - Jersey helloworld 示例从浏览器获取 404 代码

java - Apache CXF SOAP 客户端,使用 https 中生成的 stub

c# - C# 中的 Monadic 理解语法

asp.net - 使用 jQuery Ajax 将参数传递给 WebMethod

java - PHP 站点调度 Java 执行?

c# - P/通过损坏的名称调用函数

c# - 如何修复 Asp.NET MVC 中的 "This dictionary requires a model item of type"?

c# - 自定义 T4 生成器生成的类看起来很乱