.NET 命名冲突问题中的 SAP Web 服务引用
当我尝试使用 SAP ws 时,我遇到了 .net 问题, 元素系统使用此错误
error CS0120: An object reference is required for the nonstatic field, method, or property 'Bapiret2.System'
,它们是此处描述的解决方案,但我想找到一个不需要更改 WSDL 的解决方案
或这个, http://ddkonline.blogspot.com/2009 /09/sap-to-microsoft-net-integration-fixes.html
您有这方面的经验以及如何解决它吗?
谢谢 三木
i have a .net issue when im trying to consume SAP ws ,
the element system cusing this error
error CS0120: An object reference is required for the nonstatic field, method, or property 'Bapiret2.System'
their is a solution as described here BUT im want to find a solution that doesn't required to change the WSDL
or this one ,
http://ddkonline.blogspot.com/2009/09/sap-to-microsoft-net-integration-fixes.html
do you have any experience with that and how you solve it?
thanks
miki
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于此问题是由 .NET 和 SAP 中的命名冲突引起的,因此在不更改 SAP 配置的情况下解决此问题的另一种方法:
在 Reference.cs 中为 System.XML 添加一个别名,如下所示
然后,将所有报告错误的 System.Xml 替换为“SysXml”如下(请注意,“SysXml”一词在添加服务后原来是“System.Xml”,从而导致了此问题)
Since this issue is caused by naming conflict in .NET and SAP, another workaround for this issue without changing SAP configuration:
Add an alias for System.XML as below in Reference.cs
Then, replace all the System.Xml where report the error with "SysXml" as below (please note that the word "SysXml" is originally "System.Xml" after adding the service, which caused this issue)
问题是因为 Windows 和 BAPI 中的系统命名空间。这可以通过在所有给出上述错误的调用之前添加 global:: 来解决。这不涉及编辑 WSDL。
参考文献:对 和该评论引用的链接。
The problem is because System namespace in both Windows and BAPI. This can be dealt with by adding global:: before all calls giving the above errors. This does not involve editing WSDL.
References: Comment on one of the page you mentioned above and link that comment referred to.