首页 新闻 赞助 找找看

动态调用webservice时提示“此 XML 文档中禁用 DTD”

0
悬赏园豆:10 [已关闭问题] 关闭于 2014-09-19 16:32
    public static object InvokeWebService(string url, string classname, string methodname, object[] args)
        {
            string @namespace = "EnterpriseServerBase.WebService.DynamicWebCalling";
            if ((classname == null) || (classname == ""))
            {
                classname = GetWsClassName(url);
            }
            WebClient wc = null;
            Stream stream = null;
            CSharpCodeProvider csc = null;
            try
            {
                //获取WSDL
                wc = new WebClient();
                stream = wc.OpenRead(url + "?WSDL");
            //这里报错
                ServiceDescription sd = ServiceDescription.Read(stream);
}
View Code

不知道是为什么调不同系统的webservice,有一个可以调用,另一个却不可以,求解!

C#
hardy_Wang的主页 hardy_Wang | 初学一级 | 园豆:17
提问于:2014-04-15 18:05
< >
分享
所有回答(3)
0

遇到同样问题几年了,一直没解决,并发一大就出此问题。有时候app回收,也会引起

kevin-yang | 园豆:202 (菜鸟二级) | 2015-11-30 17:20
0

这个问题有解决吗?

我在网上搜索了两个地方有提到,但是不能合理解决你发的疑问

https://bytes.com/topic/c-sharp/answers/846287-xml-prohibitdtd-error
http://stackoverflow.com/questions/13854068/dtd-prohibited-in-xml-document-exception 
 
快递小哥 | 园豆:202 (菜鸟二级) | 2016-03-08 15:58
0

有解决方案吗

lypzxy | 园豆:202 (菜鸟二级) | 2021-05-31 11:14
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册