I have setup a wcf service. Unfortunately, when I call the service over fiddler, the web, or whereever, I get an http 400 error. I am really perplexed at where to start to solve this problem. Any suggestions are appreciated. WSDL is not an option at this time. REST is a requirement. I was able to make calls previously using GET, however, get is not secure as I need to pass the userid and password to validate and that would be easily viewable.
The wcf service has the following interface:
[WebInvoke(UriTemplate = "/Login", Method="POST",
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Wrapped)]
[OperationContract]
bool Login(string UserName, string PassWord, string AppKey);
The service has the following code. yes, this code is incomplete and I know that AppKey really doesn't do anything, its there as a place holder at this point.
public bool Login(string UserName, string PassWord, string AppKey)
{
bool bl = false;
if (String.IsNullOrEmpty(AppKey))
{
throw (new ApplicationException(AppKeyNull));
}
if (Membership.ValidateUser(UserName, PassWord))
{
bl = true;
}
return (bl);
}
I am trying to call the service over fiddler. I have the following url:
http://127.0.0.1:82/WebServices/RemoteAPI.svc/Login
I have the following header setup:
User-Agent: Fiddler
Host: 127.0.0.1:82
Content-Length: 46
Content-Type: application/x-www-form-urlencoded
I have the following body setup:
UserName=xxxxxx&PassWord=yyyyyy&AppKey=blah