Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# XmlSerializer属性在使用WCF的Web服务中无效_C#_.net_Wcf_Web Services_Soap - Fatal编程技术网

C# XmlSerializer属性在使用WCF的Web服务中无效

C# XmlSerializer属性在使用WCF的Web服务中无效,c#,.net,wcf,web-services,soap,C#,.net,Wcf,Web Services,Soap,我使用WSCF.blue生成基于WSDL和xsd的web服务类。调用web服务时,我收到以下错误: “XmlSerializer属性System.Xml.Serialization.XmlAttributeAttribute在电子邮件中无效。当IsWrapped为true时,仅支持XmlElement、XmlArray、XmlArrayItem、XmlAnyAttribute和XmlAnyElement属性。” 我使用svcuti.exe得到了相同的结果。(VS 2010,.NET Framew

我使用WSCF.blue生成基于WSDL和xsd的web服务类。调用web服务时,我收到以下错误:

“XmlSerializer属性System.Xml.Serialization.XmlAttributeAttribute在电子邮件中无效。当IsWrapped为true时,仅支持XmlElement、XmlArray、XmlArrayItem、XmlAnyAttribute和XmlAnyElement属性。”

我使用
svcuti.exe
得到了相同的结果。(VS 2010,.NET Framework 3.5)

有人听说过这个问题吗

使用
WSDL.exe
(旧web服务.NET 2.0)生成代码会得到预期的结果,但返回值总是来自类型对象,其中WSCF.blue会给我一个特定的返回对象(例如ResponseProfileDto而不是object)

其中一个类定义如下所示:

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="ResendEmailRequest", WrapperNamespace="http://xy.com/test", IsWrapped=true)]
public partial class ResendEmailRequest
{

    [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://xy.com/test", Order = 0, Name = "Email")]
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string Email;

    [System.ServiceModel.MessageBodyMemberAttribute(Namespace = "http://xy.com/test", Order = 1, Name = "LoginName")]
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string LoginName;

    public ResendEmailRequest()
    {
    }

    public ResendEmailRequest(string Email, string LoginName)
    {
        this.Email = Email;
        this.LoginName = LoginName;
    }
}

关于

尝试使用
/wrapped
属性创建带有
svcutil
的代码


希望这对.net中的核心命令有帮助:dotnetsvcuti--wrapped