I have a Web service in which the result is a <List>
. I can get the result without problems. What I'm looking to do is just show me the result depending on the value of the result is equal to 1.
Here is the structure of the Web service and what it shows in the result:
<Response>
<List>
<anyType xsi:type="xsd:string">Q9Row1</anyType>
<anyType xsi:type="xsd:string">Q9Comment1</anyType>
<anyType xsi:type="xsd:string">Q10Row1</anyType>
<anyType xsi:type="xsd:string">Q10Comment1</anyType>
<anyType xsi:type="xsd:string">Q11Row1</anyType>
</List>
</Response>
<Response>
<List>
<anyType xsi:type="xsd:string">1</anyType>
<anyType xsi:type="xsd:string">2</anyType>
<anyType xsi:type="xsd:string">2</anyType>
<anyType xsi:type="xsd:string">1</anyType>
<anyType xsi:type="xsd:string">1</anyType>
</List>
</Response>
What I want is that if in <Q9Row1>
the result is 1 in <anyType xsi:type="xsd:string">1</anyType>
show me the result. If the result is other than 1. That the program does not show me anything.
Here is the form which I originally called the service before getting what I mention.
public static string arrayToString(object[] array)//overload
{
string s = "";
for (int i = 0; i < array.Length; ++i)
{
s += array[i].ToString() + " , ";
}
if (s.Length > 3) { s = s.Substring(0, s.Length - 3); }
return s;
}
WebRefernce.DashboardSoapClient db = new WebRefernce.DashboardSoapClient();
WebRefernce.Response[] resp = db.GetResponse();
for (int i = 0; i < resp.Length; ++i)
{
textBox1.Text += Form1.arrayToString(resp[i].List);
}
What I originally do is just post the result. Now I'm looking to post it but only show when = 1
As much as Q9Row1 and 1 are values from the list. The Q9Row1 is the header of the answer and the 1 is the result of this. But both are non-property values.
I included a screenshot of the result of resp.
The first screenshot shows as poster the Q9Row1 in the first string I require.
This second screenshot shows when the result happens for the second time in for resp.Length
and there it shows me the 1
Is there any way to do this in C #?