I have Written a webservice with VS2008 after I had Added Reference to that service in VS2003,I encountered a problem calling methods which return nullable values such as int? if I fill that feild with a value,the problem solves. Is There any other way to solve this problem?
Some more Information
Please Look at these extract from my own code:
public RevolverFund[] RetrieveRevolverFundList(int accountSetupOrganId, [System.Xml.Serialization.XmlIgnoreAttribute()] bool accountSetupOrganIdSpecified)
{
object[] results = this.Invoke("RetrieveRevolverFundList", new object[]
{
accountSetupOrganId,
accountSetupOrganIdSpecified
});
return ((RevolverFund[])(results[0]));
}
It is generated by VS2003 automatically when I add the web reference to my solution. these lines of code located in 'Reference.cs' file. RevolverFundView is a class that has some nullable properties the exception "There is an error in XML document (1, 481)." is thrown whenever the 'Invoke' Method is called.
by the way here is declaration of RevolverFundClass
public class RevolverFund {
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string Comment;
public int EmployeeCode;
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool EmployeeCodeSpecified;
public int Id;
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool IdSpecified;
public int OrganId;
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool OrganIdSpecified;
}
in 'RevolverFund' class , 'EmployeeCode' and 'OrganId' properties are declared as 'Nullable Int's
**and here is The RevolverFund class difinition In VS2008**
[DataContract]
public class RevolverFund
{
private Int32 m_Id;
[DataMember]
public Int32 Id
{
get { return m_Id; }
set { m_Id = value; }
}
private Int32? m_EmployeeCode;
[DataMember]
public Int32? EmployeeCode
{
get { return m_EmployeeCode; }
set { m_EmployeeCode = value; }
}
private Int32? m_OrganId;
[DataMember]
public Int32? OrganId
{
get { return m_OrganId; }
set { m_OrganId = value; }
}
private String m_Comment;
[DataMember]
public String Comment
{
get { return m_Comment; }
set { m_Comment = value; }
}
}