方法'XYZ'无法反映 [英] Method 'XYZ' cannot be reflected

查看:275
本文介绍了方法'XYZ'无法反映的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经使用了第三方Web服务,并试图从ASP.NET Web应用程序中调用它。
但是当我实例化Web服务时,抛出以下System.InvalidOperationException异常:

We have consumed a third party web service and are trying to invoke it from an ASP.NET web application. However when I instantiate the web service the following System.InvalidOperationException exception is thrown:


方法'ABC.XYZ'不能被反映。
System.InvalidOperationException:
方法'ABC.XYZ'无法反映。
---> System.InvalidOperationException:命名空间中的XML元素MyDoc
' http:// mysoftware.com/ns 引用
a方法和一个类型。使用
WebMethodAttribute更改
方法的消息名称,或使用
XmlRootAttribute更改
类型的根元素。

Method 'ABC.XYZ' can not be reflected. System.InvalidOperationException: Method 'ABC.XYZ' can not be reflected. ---> System.InvalidOperationException: The XML element 'MyDoc' from namespace 'http://mysoftware.com/ns' references a method and a type. Change the method's message name using WebMethodAttribute or change the type's root element using the XmlRootAttribute.

从我收集的内容中,Web服务中的方法和类型之间似乎有些歧义。
任何人都可以澄清这个异常的可能原因,有没有什么可以做的来纠正这一点,还是应该去网络服务所有者纠正?

From what I can gather there appears to be some ambiguity between a method and a type in the web service. Can anyone clarify the probably cause of this exception and is there anything I can do to rectify this or should I just go to the web service owners to rectify?

编辑:Visual Studio 2008创建了代理类。不幸的是,我无法提供到wsdl的链接,因为它是本地安装的第三方应用程序的Web服务。

Visual Studio 2008 has created the proxy class. Unfortunately I can't provide a link to the wsdl as it is a web service for a locally installed thrid party app.

推荐答案

似乎问题是VS和使用Java编写的Web服务之间的数据类型问题。

It seems the problem is down to data type issues between VS and the web service that was written in Java.

最终它是通过手动编辑类和模式文件来修复的由VS创建。

Ultimately it was fixed by manually editing the class and schema files that were created by VS.

这篇关于方法'XYZ'无法反映的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆