Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight4 calling ASMX web service
    primarykey
    data
    text
    <p>I have a Visual Studio solution with a Silverlight project, and a web project which hosts the Silverlight app. The web project also contains an ASMX web service which is called by the Silverlight ap.</p> <p>As described below, certain calls to the web service work fine, and yet others cause a CommunicationException to be thrown, wrapping a WebException - both with the message "The server returned the following error: 'not found'".</p> <p>Firstly, here's my original method, which failed as described above (entity names changed for simplicity):</p> <pre><code>[WebMethod] public Customer GetCustomer(int id) { CustomerDataContext dc = new CustomerDataContext(); return dc.Customers.SingleOrDefault(x =&gt; x.Id == id); } </code></pre> <p>Secondly, to debug the problem I took Linq to SQL and the database out of the picture, and the below code worked fine:</p> <pre><code> [WebMethod] public Customer GetCustomer(int id) { Customer c = new Customer() { ID=1, Name="Bob", History = new EntitySet&lt;CustomerHistory&gt;() }; return c; } </code></pre> <p>Third, thinking about this, one difference between the two methods is that the first one would include values in the customer history. I extended the second method to include this, and it started failing again:</p> <pre><code> [WebMethod] public Customer GetCustomer(int id) { Customer c = new Customer() { ID=1, Name="Bob", History = new EntitySet&lt;CustomerHistory&gt;() }; c.History.Add(new CustomerHistory() { Id=1, CustomerId=1, Text="bla" }); return c; } </code></pre> <p>I'm stuck with regards to how to progress - my current thinking is that this could be a deserialization issue on the Silverlight side, when the object graph is deeper. This rationally doesn't make sense, but I can't think of anything else. I've confirmed that the transfer size and buffer size are big enough (2GB by default).</p> <p>Any pointers would be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload