Passing value in an array in webservice

This is my code in the webservice

private object[] _myObjectVariableList = new object[7];

public object[] MyObjectVariableList
{
    get { return _myObjectVariableList; }
    set { _myObjectVariableList = value; }
}

and when I pass a value to it using

 AuditTrail auditclass = new AuditTrail();
 auditclass.MyObjectVariableList[indexCounter] = myTextBox.Text;

I receive an error

Object reference not set to an instance of an object.

I really do not know whats happening

Any ideas?

Answers


you need to initialize the list in client side

AuditTrail auditclass = new AuditTrail(); 

auditclass.MyObjectVariableList = new object[7];

or in service class constructor initialize the property value

public class AuditTrail 
{
    private object[] _myObjectVariableList;

    public object[] MyObjectVariableList
    {
        get { return _myObjectVariableList; }
        set { _myObjectVariableList = value; }
    }
    public AuditTrail()
    {
        MyObjectVariableList= new object[7];
    }
}

Need Your Help

using const_cast to pass const data argument to a function whose parameter is a non-const

c++ const-cast

We can use const_cast to pass const data argument to a function whose parameter is a non-const.

Checking for Multigraph Isomorphism in Python iGraph

python igraph

I'm running igraph on python and I've noticed that igraph does not implement graph isomorphism checks properly for multigraphs. As an example: