I test service by Fidder and the error is : 400 bad request.
This my web.config :
contract="MyService.IMyService"
behaviorConfiguration="maxRequest">
and the webservice method (just to check webservice have receive of not.)
[WebInvoke(Method = "POST", UriTemplate = "/File",
RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml)]
public bool UploadFile(Stream fileContents)
{
string email, itemtId, codeimg, format;
using (StreamReader reader = new StreamReader(fileContents))
{
string[] separators = { "{\"", "\":\"", "\",\"", "\"}", "email", "format", "stringcodeimg", "itemid" };
string contents = reader.ReadToEnd();
string[] words = contents.Split(separators, StringSplitOptions.RemoveEmptyEntries);
email = words[0];
format = words[1];
codeimg = words[2];
itemtId = words[3];
}
return true;
}
Replies
Know the answer? Post it — somebody with the same question will find it here.