J
John Grandy
make a call to XML Web Service WebMethod ... returns object[] myArray with
no error ...
myArray[] contains objects of type StringKeyStringValue
runtime error occurs on accessing properties of myArray
<<<
ex.Message "Server was unable to process request. --> There was an error
generating the XML document. --> UtilityStorageLibrary.StringKeyStringValue
cannot be serialized because it does not have a default public constructor."
using System;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization.Formatters.Soap;
namespace UtilityStorageLibrary
{
[Serializable()]
public class StringKeyStringValue
{
private String stringKey = null;
private String stringValue = null;
public StringKeyStringValue()
{
}
public StringKeyStringValue(String stringKey, String stringValue)
{
this.stringKey = stringKey;
this.stringValue = stringValue;
}
public string Key
{
get
{
return stringKey;
}
}
public string Value
{
get
{
return stringValue;
}
}
}
}
no error ...
myArray[] contains objects of type StringKeyStringValue
runtime error occurs on accessing properties of myArray
<<<
ex.Message "Server was unable to process request. --> There was an error
generating the XML document. --> UtilityStorageLibrary.StringKeyStringValue
cannot be serialized because it does not have a default public constructor."
using System;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization.Formatters.Soap;
namespace UtilityStorageLibrary
{
[Serializable()]
public class StringKeyStringValue
{
private String stringKey = null;
private String stringValue = null;
public StringKeyStringValue()
{
}
public StringKeyStringValue(String stringKey, String stringValue)
{
this.stringKey = stringKey;
this.stringValue = stringValue;
}
public string Key
{
get
{
return stringKey;
}
}
public string Value
{
get
{
return stringValue;
}
}
}
}