Problems passing an array to a web service

I right click on the Notification object and click on Show Definition

public class Notification

{ public Notification();

public string Message { get; set; } public Provider[] Recipients { get; set; } public string Sender { get; set; } public string Subject { get; set; } 

}

I need to add a Provider object to that array there but it's not working.

I new up the object: Notification myNotification = new Notification();

At run time, the size of the array for the Recipients has been set to null. I can't seem to find a way to tell the #$&^ that it should open up it's stupid mouth and let me add an instance of Provider to it.

How might I go about this?

Tanks.

by SequesterMe via /r/csharp

1 Comment

  1. Chad Sigler says: Reply

    Provider p = new Provider();
    List pList = new List();
    pList.Add(p);

    //when you call the method to send to webservice:
    Webservice a = new webservice(); //create web service object
    a.sendinfo(param1,param2,pList.ToArray(),param3);

Leave a Reply