Мой текущий XML-ответ показан ниже (показаны только важные части). Я добавил служебную ссылку, которая сгенерировала для меня некоторые прокси-классы, которые, к сожалению, не возвращают вывод по мере необходимости. Приведенный ниже код на c # возвращает только последний«значения» данных.В конечном итоге я хочу иметь массивы «значений», которые я буду отображать в виде сетки.
<return>
<fields></fields>
<fields></fields>
<fields></fields>
<values>
<value></value>
<value></value>
<value></value>
</values>
<values>
<value></value>
<value></value>
<value></value>
</values>
//proxy class
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://ws.server.mhaccess.crimsonlogic.com/")]
public partial class qwsOutput : baseWebServiceOutput {
private string[] fieldsField;
public List<string> values { get; set; }
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("fields", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=0)]
public string[] fields {
get {
return this.fieldsField;
}
set {
this.fieldsField = value;
this.RaisePropertyChanged("fields");
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = true, Order = 1)]
[System.Xml.Serialization.XmlArrayItemAttribute("value", typeof(string[]), Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public List<string> value
{
get
{
return this.values;
}
set
{
this.values = value;
this.RaisePropertyChanged("values");
}
}
}
//code use to call soap request
SoapService.queryWebServiceSoapPortClient client = new
SoapService.queryWebServiceSoapPortClient();
client.ClientCredentials.UserName.UserName = userID;
client.ClientCredentials.UserName.Password = Password;
SoapService.qwsInput query1 = new SoapService.qwsInput();
SoapService.queryResponse response = new
SoapService.queryResponse();
query1.userId = userID;
query1.pass = Password;
query1.queryId = queryId;
query1.qwsInputParams = InputParam;
query a = new query();
a.queryInput = query1;
try
{
response = client.query(a);
}
catch (Exception error)
{
var b = error.ToString();
}
// обновленный код
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://ws.server.mhaccess.crimsonlogic.com/")]
public partial class qwsOutput : baseWebServiceOutput {
private string[] fieldsField;
//private string[][] valuesField;
private object[] valuesField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("fields", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=0)]
public string[] fields {
get {
return this.fieldsField;
}
set {
this.fieldsField = value;
this.RaisePropertyChanged("fields");
}
}
///// <remarks/>
//[System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=1)]
//[System.Xml.Serialization.XmlArrayItemAttribute("values", typeof(returnValues), Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlElementAttribute("values", typeof(returnValues), Form = System.Xml.Schema.XmlSchemaForm.Unqualified, Order = 1)]
public object[] values {
get {
return this.valuesField;
}
set {
this.valuesField = value;
//this.RaisePropertyChanged("values");
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class returnValues
{
private returnValuesValue[] valueField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("value", Form =
System.Xml.Schema.XmlSchemaForm.Unqualified)]
public returnValuesValue[] value
{
get
{
return this.valueField;
}
set
{
this.valueField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class returnValuesValue
{
}