+ -
当前位置:首页 → 问答吧 → 急问:读取本地wsdl文件动态实现SOAP请求,反射客户端类时失败,谢谢!

急问:读取本地wsdl文件动态实现SOAP请求,反射客户端类时失败,谢谢!

时间:2011-12-16

来源:互联网

使用framework2.0 调试时报:反射"string1"出错。把动态编译出来的客户端代码打出来一看,发现是成员变量MessageID是这个类型:

public @string MEName;
   
public string1 MessageID;

从代码上看,@string和string1的两个定义效果是一样的,唯一差别在于XmlTypeAttribute的定义,string1比@string多了一个属性TypeName:
@string的定义如下:
/// <remarks/>
  [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdlWatcher", "1.0.0.0")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.w3.org/2001/XMLSchema")]
  [System.Xml.Serialization.XmlRootAttribute("MEName", Namespace="http://www.chinamobile.com/IMS/MMTelAS/", IsNullable=false)]
  public partial class @string : System.Web.Services.Protocols.SoapHeader
  {
   
  /// <remarks/>
  [System.Xml.Serialization.XmlTextAttribute()]
  public string[] Text;
  }

string1的定义如下:
/// <remarks/>
  [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdlWatcher", "1.0.0.0")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(TypeName="string", Namespace="http://www.w3.org/2001/XMLSchema")]
  [System.Xml.Serialization.XmlRootAttribute("MessageID", Namespace="http://www.chinamobile.com/IMS/MMTelAS/", IsNullable=false)]
  public partial class string1 : System.Web.Services.Protocols.SoapHeader
  {
   
  /// <remarks/>
  [System.Xml.Serialization.XmlTextAttribute()]
  public string[] Text;
  }

搜到一个跟我有一样问题的帖子,可惜没有解决方案T_T
http://social.msdn.microsoft.com/Forums/zh-CN/vsprereleaseannouncements/thread/c2d15766-fb5c-49ff-a8bd-3b5d13fff207

作者: indypj   发布时间: 2011-12-16

自己顶一下。

作者: indypj   发布时间: 2011-12-16

该回复于2011-12-16 15:10:05被管理员删除

  • 对我有用[0]
  • 丢个板砖[0]
  • 引用
  • 举报
  • 管理
  • TOP
  • indypj
  • (清河舞)
  • 等 级:
#3楼 得分:0回复于:2011-12-16 15:18:10

作者: indypj   发布时间: 2011-12-16