找不到C#Web服务(404)。
此代码以前工作,现在已停止工作:/ 我在应用程序的其他区域使用相同的代码,可以调用运行良好的链接。但在我的应用程序的这个特定部分,它停止了工作 此链接是有效的,如上所述,它用于工作 这是代码找不到C#Web服务(404)。,c#,asp.net,web-services,C#,Asp.net,Web Services,此代码以前工作,现在已停止工作:/ 我在应用程序的其他区域使用相同的代码,可以调用运行良好的链接。但在我的应用程序的这个特定部分,它停止了工作 此链接是有效的,如上所述,它用于工作 这是代码 WebClient client = new WebClient(); string xmlResult = client.DownloadString(_workContext.AccountingWebServiceLink + "?action=updateprimary&xml=" + s
WebClient client = new WebClient();
string xmlResult = client.DownloadString(_workContext.AccountingWebServiceLink + "?action=updateprimary&xml=" + strXML);
我不确定是否需要增加IIS中的字节大小?我怀疑这可能与发送的数据量有关。您可以查看提供该服务的服务器上的IIS日志,看看请求是什么吗?你是否使用URLEncode
strXML
?我试过URLEncode,得到了500分error@AndrewMortonIIS日志中没有关于今天日期的任何内容。可能\u workContext.AccountingWebServiceLink
的值不是您在代码中想要的值?如果您收到404和500个错误,这表明它正在连接到某个web服务器。@AndrewMorton的_workContext.AccountingWebServiceLink值是正确的……即使我使用UrlEncode,我现在也收到400个错误。但是,当我只使用xml值xml=时,它就可以正常工作了。