Wednesday, December 9, 2009

The Remote Server returned and error: NotFound.

Today I spent a fair amount of time tracking down a problem that I first thought was a WCF Web Service Issues but turns out to be a
Linq To SQL issue / Visual Studio issue.

Here are the steps I followed to create the issue.

1. So for this project I added a Li3.nq to Sql class, say by the name StoredProcContext.dbml.

2. After that I added a stored procedure to the StoredProcContext.dbml via the designer.

3. Here be the issue. When you add a Stored Proc that returns a result and the size is a single Char(1).

4. Typically if the results return a Char(10) the result class that gets generated makes the result a "string". However, if it is a Char(1) it keeps it as a Char type.
Member Variable:


Property Variable






5. This will cause an error when calling the web service. "The Remote Server returned and error: NotFound.



Solution:
Go into your LinqToSql Class and find your result object class and change the private member variable from char to String. Also don't forget to change the Property return type for the same variable to a string as well.

No comments:

Post a Comment