执行远程过程/方法后,显然会出现错误。我认为远程服务最有可能发送回错误数据。我试过在Web.Config中增加readQuote,这没什么用。
响应级
设置此属性(MultiSMSPostedList)时,该值为NULL。一旦代码从get中出来,就抛出异常。
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.5485")]
[System.SerializableAttribute()]
//[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.SoapTypeAttribute(Namespace="urn")]
public partial class MessagingServices_SendMultiSMSResult : object, System.ComponentModel.INotifyPropertyChanged {
private int sMSCountField;
private MessagingServices_SendMultiSMS_SendSuccess[] multiSMSPostedListField;
private MessagingServices_SendMultiSMS_SendFailed[] multiSMSRejectedListField;
/// <remarks/>
public int SMSCount {
get {
return this.sMSCountField;
}
set {
this.sMSCountField = value;
this.RaisePropertyChanged("SMSCount");
}
}
/// <remarks/>
[System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
public MessagingServices_SendMultiSMS_SendSuccess[] MultiSMSPostedList {
get {
return this.multiSMSPostedListField;
}
set {
this.multiSMSPostedListField = value;
this.RaisePropertyChanged("MultiSMSPostedList");
}
}
/// <remarks/>
[System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
public MessagingServices_SendMultiSMS_SendFailed[] MultiSMSRejectedList {
get {
return this.multiSMSRejectedListField;
}
set {
this.multiSMSRejectedListField = value;
this.RaisePropertyChanged("MultiSMSRejectedList");
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
异常 下面是异常文本,它清楚表明当系统尝试将变量转换为数组时会引发异常。 http://justpaste.it/sms-exception
更多信息
进一步挖掘表明远程服务正在返回正确数量的值,如果不是格式。
此属性 MultiSMSPostedList 根据传递给原始过程/方法的值的数量调用以下类。 (即如果我传递了两个电话号码和两条短信, MessagingServices_SendMultiSMS_SendSuccess 中的属性被初始化两次,表明远程服务器返回了一个数组)
物业类
public partial class MessagingServices_SendMultiSMS_SendSuccess : object, System.ComponentModel.INotifyPropertyChanged {
private string gRecipientNameField;
private string gRecipientMSISDNwithCCField;
private int gOutMsgIDField;
/// <remarks/>
[System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
public string gRecipientName {
get {
return this.gRecipientNameField;
}
set {
this.gRecipientNameField = value;
this.RaisePropertyChanged("gRecipientName");
}
}
/// <remarks/>
[System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
public string gRecipientMSISDNwithCC {
get {
return this.gRecipientMSISDNwithCCField;
}
set {
this.gRecipientMSISDNwithCCField = value;
this.RaisePropertyChanged("gRecipientMSISDNwithCC");
}
}
/// <remarks/>
public int gOutMsgID {
get {
return this.gOutMsgIDField;
}
set {
this.gOutMsgIDField = value;
this.RaisePropertyChanged("gOutMsgID");
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
我确信,visual studio无法根据WSDL数据正确生成类,我可能需要对reference.cs文件进行一些更改。我不是这方面的专家,所以不确定我应该在哪里和哪里做出改变?
可能有用
远程服务是基于java的轴Web服务。
更多信息:对reference.cs所做的更改
我在下面对响应类进行了更改,并且它没有任何异常。由于它是一个变量而不是数组,因此我只得到第一个响应而所有其他响应值都丢失了。
private MessagingServices_SendMultiSMS_SendSuccess[] multiSMSPostedListField;
private MessagingServices_SendMultiSMS_SendFailed[] multiSMSRejectedListField;
我不确定reference.cs中究竟在哪里可以找到远程调用/结束的位置,可能会有所帮助。有什么建议吗?