SOAP存根无法将类型转换为相同类型 [英] SOAP stub is unable to cast a type to the same type

查看:80
本文介绍了SOAP存根无法将类型转换为相同类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的一位客户在运行Atlassian Connector for Visual Studio时遇到问题,这是一个VS扩展包。也就是说,当连接器执行SOAP调用时(通过从WSDL生成的存根),抛出以下异常:


Hi,

One of my customers is having a problem running the Atlassian Connector for Visual Studio, which is a VS extension package. Namely, when the connector performs the SOAP call (through a stub generated from WSDL), the following exception is thrown:

[A]Atlassian.plvs.Atlassian.plvs.api.soap.service.RemoteProject[] cannot be cast to [B]Atlassian.plvs.Atlassian.plvs.api.soap.service.RemoteProject[]. Type A originates from 'plvs2008, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadNeither' at location 'C:
Program Files
Atlassian Connector For Visual Studio
plvs2008.dll'. Type B originates from 'plvs2008, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom' at location 'C:\Program Files\Atlassian Connector For Visual Studio\plvs2008.dll'.



该异常表明,类型[A]的上下文中的路径在其中具有'\ n'个字符而不是'\\'。我不知道这里发生了什么。更糟糕的是,我无法控制SOAP存根的工作方式以及加载代码的方式。

为了记录,存根失败的部分如下所示:



The exception would suggest that somehow the path in the context for type [A] has '\n' characters in it instead of '\\'. I am at a loss as to what's going on here. What's worse, I do not control how the SOAP stub works and in what way it loads code.

For the record, the part of the stub that fails looks like this:


        [System.Web.Services.Protocols.SoapRpcMethodAttribute(""
, RequestNamespace="http://soap.rpc.jira.atlassian.com"
, ResponseNamespace="http://jira.atlassian.com/rpc/soap/jirasoapservice-v2"
)]
        [return
: System.Xml.Serialization.SoapElementAttribute("getProjectsNoSchemesReturn"
)]
        public
 RemoteProject[] getProjectsNoSchemes(string
 in0) {
            object
[] results = this
.Invoke("getProjectsNoSchemes"
, new
 object
[] {
                        in0});
            return
 ((RemoteProject[])(results[0]));
        }

推荐答案

您在使用绑定上下文时遇到问题: http://blogs.msdn.com/suzcook/archive/2003/05/29/57143。 aspx
这就是"在上下文中'LoadNeither'"与"在上下文中加载'LoadFrom'"你的错误的一部分。 fuslogvw.exe 应该可以帮助您确认。

您需要找出哪一段代码在哪个上下文中加载程序集。不幸的是,我一般不知道如何做到这一点。所以希望程序集的名称以及你和VS在同一个程序集上使用LoadFile和LoadFrom这一事实对你有帮助。如果没有,请告诉我,我会尝试深入挖掘。

谢谢,
-Karel

You have trouble with binding context: http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx
That's the "in the context 'LoadNeither'" vs. "in the context 'LoadFrom'" part of your error. fuslogvw.exe should help you confirm that.

You need to find out which piece of code loads the assembly in which context. Unfortunately I don't know how to do that in general. So hopefully the name of the assembly and the fact that you and VS used LoadFile and LoadFrom on the same assembly will help you. If not, let me know and I'll try to dig deeper.

Thanks,
-Karel


这篇关于SOAP存根无法将类型转换为相同类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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