Can't transfer list<T> to web service?
<p>I have the same classes on my server and on my web service.
I have the following WebMethod:</p>

<pre><code>[WebMethod]
        public int CreateOrder(List&lt;Purchase&gt; p, string username)
        {
            o.Add(new Order(p,username));

            return o.Count;
        }
</code></pre>

<p>However the following code, run at server:</p>

<pre><code>protected void CartRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        List&lt;Purchase&gt; l = ((List&lt;Purchase&gt;)Session["Cart"]);

        if (e.CommandName == "Order")
        {
            localhost.ValidateService WS = new localhost.ValidateService();
            WS.CreateOrder(l, Session["username"].ToString());
        }
    }
</code></pre>

<p>gives the following error: <code>Argument '1': cannot convert from 'System.Collections.Generic.List&lt;Purchase&gt;' to 'localhost.Purchase[]'</code>.</p>

<p>How can I transfer the <code>list&lt;Purchase&gt;</code> object to the web service?</p>

<p>Thank you very much.</p>
