【发布时间】:2012-03-06 19:51:52
【问题描述】:
在尝试创建服务实例时,我得到了一个
“方法无法反映”
异常。深入挖掘内部异常会发现:
“类型 'WebServiceClient.com.compamy.string1' 和 'WebServiceClient.com.company.string' 都使用 XML 类型名称, “字符串”,来自命名空间“http://www.w3.org/2001/XMLSchema”。使用 XML 属性来指定一个唯一的 XML 名称和/或命名空间 类型。”
这该死的东西想从我这里得到什么?是VS2010自动生成的代码……我为什么要摆弄它?
这里有两种类型:
[GeneratedCode( "System.Xml", "4.0.30319.233" )]
[Serializable]
[DebuggerStepThrough]
[DesignerCategory("code")]
[XmlType(TypeName = "string", Namespace = "http://www.w3.org/2001/XMLSchema")]
[XmlRoot("FileName", Namespace = "http://company.com/api3/Content/Download/", IsNullable = true)]
public partial class string1 : SoapHeader
和
[GeneratedCode("System.Xml", "4.0.30319.233" )]
[Serializable]
[DebuggerStepThrougt]
[DesignerCategory("code")]
[XmlTypeAttribute(Namespace = "http://www.w3.org/2001/XMLSchema")]
[XmlRootAttribute("SessionKey", Namespace = "ns", IsNullable = true)]
public partial class @string : SoapHeader
【问题讨论】:
-
为什么不把它命名为
StringHeader : SoapHeader?
标签: .net web-services asmx