Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This problem is very typical when consuming SOAP web services that were written in Java and then consumed by WCF, C#, .Net, etc. where jagged arrays (arrays of arrays) are used. VinayC's post helped, but here is some more explicit code for example that may help others who encounter this problem.</p> <p>Note that these classes are abbreviated. Your WSDL generated code will surely look more complex.</p> <pre><code>public partial class assests{ private multiValuedAttribute[] attributesField; [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] public multiValuedAttribute[] attributes{ get {return this.attributesField;} set {this.attributesField = value;} } } public partial class listAssetsQueryResults{ private assests[] assetsField; [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] public assets[] assets{ get {return this.assetsField;} set {this.assetsField = value;} } } </code></pre> <p>The key here is to create a new 'assets' class that is a link between multiValuedAttribute and listAssetsQueryResults classes, and then serialize the field using XmlElementAttribute. A good way to do this in your own projects is to start by copying and pasting the class that is analogous to the multiValuedAttribute class (although that class implementation is not shown here). Then, just rename the copied multiValuedAttribute class as 'assets' and alter the implementation so that it instead works as a link between the two. Remove the extra [] in the statements that contain [][] in the listAssetsQueryResults class. Serialize using XmlElement instead of XmlArrayItem.</p> <p>Of course, different services have different requirements. <strong>The Fiddler application (<a href="http://fiddler2.com/" rel="nofollow">http://fiddler2.com/</a>) can really help inspect the serialization to make sure you're getting it right.</strong> Fiddler really really helped me. Here is some additional reading that helped me as well: <a href="http://msdn.microsoft.com/en-us/library/2baksw0z.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/2baksw0z.aspx</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload