方法'某某'不能反映 [英] Method 'XYZ' cannot be reflected

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

问题描述

我们已经消耗了第三方网站的服务,并试图从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 '引用
  一种方法和一种类型。更改
  使用方法的消息名称
  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服务的类型之间存在一些不确定性。
任何人都可以澄清这一异常的可能原因,有什么我可以做,以纠正这种,或者我应该只是去到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,因为它是一个本地安装的THRID第三方的应用的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.

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

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