I'm new to WCF Web Service and don't know a lot how to debug web services...
Following examples, I created a Web service which has the interface like this:
public interface IMyService
{
[OperationContract]
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
List<MyClass> GetData(string param);
}
and the implementation which returns a list of MyClass.
After the deployment, I called the service in Fiddler like
http://localhost/MyService.svc/GetData?keyword=blabla
It returns:
HTTP/1.1 401 Unauthorized
Server: Microsoft-IIS/7.5
SPRequestGuid: blabla
WWW-Authenticate: blabla
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 14.0.0.6114
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS
Date: Mon, 12 Nov 2012 17:24:08 GMT
Content-Length: 0
and if I just write in the composer:
http://localhost/MyService.svc/GetData
without the param, it returns un empty json with status 200.
When I try the first request in Chrome, it demanded consecutively my username and password to the server, but entering them didn't help me get out of the loop(of demanding username and password).
Has anyone encountered problem like this? Or could you give any suggestion on the debugging?