Reputation: 905
My soap endpoint adress returns soap response like that and .net can not serialize the queryParameter queryParameter queryParameter levels. It returns as null.
How can we fix this problem?
<ResultInfos>
<ResultInfos>
<queryParameter>
<queryParameter>
<queryParameter>
<parameterFormat/>
<parameterName/>
<parameterType>dfgsfgsd</parameterType>
<parameterValue>2342234</parameterValue>
</queryParameter>
<queryParameter>
<parameterFormat/>
<parameterName/>
<parameterType>safd</parameterType>
<parameterValue>234234</parameterValue>
</queryParameter>
<queryParameter>
<parameterFormat/>
<parameterName/>
<parameterType>sfsdf</parameterType>
<parameterValue>3454</parameterValue>
</queryParameter>
<queryParameter>
<parameterFormat/>
<parameterName/>
<parameterType>234234</parameterType>
<parameterValue>A</parameterValue>
</queryParameter>
</queryParameter>
</queryParameter>
</ResultInfos>
</ResultInfos>
Upvotes: 1
Views: 235
Reputation: 905
We will edit the reference.cs that .net produce. .Net can not handle that kind of response. We will help it.
Open your web service reference.cs and add these lines to top of your class. In our case queryparameter[][].
Keyword is NestingLevel attirabute .
[System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)]
[System.Xml.Serialization.XmlArrayItemAttribute("queryParameter", Namespace = "http://wsserver", IsNullable = false)]
[System.Xml.Serialization.XmlArrayItemAttribute("queryParameter", Namespace = "http://wsserver", IsNullable = false, NestingLevel = 1)]
[System.Xml.Serialization.XmlArrayItemAttribute("queryParameter", Namespace = "http://wsserver", IsNullable = false, NestingLevel = 2)]
public QueryParameter[][] queryParameter {
get {
return this.queryParameterField;
}
set {
this.queryParameterField = value;
}
}
Upvotes: 1