I\'ve got this application that works locally and when deployed and using a .mdf SQL Express database file (which I usually use for testing purposes). However, when I change
This could be that you are making a POST but the service is expecting a GET.
Try specifying that the method should be a POST:
[WebInvoke(Method = "POST", UriTemplate = "", ResponseFormat = WebMessageFormat.Json)]
The other this that it could be is that you are using a trusted connection. This means that the security context is the identity of the application pool (if defaults are used). Then you will be making a connection to the database using a local account that does not have access on a database on a different machine.
The strange thing is that based on the error message it should be the first explaination, but based on your description it would be the second.