I am getting an error:
Operation \'addUser\' in contract \'IService1\' has a UriTemplate that expects a parameter named \'PHONE_NO,DP,REG_ID\', but there
Your service can be something like this
[ServiceContract]
public class TestService
{
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "/AddUser/{phoneNo}/{regId}")]
public string AddUser(string phoneNo, String regId, Stream image)
{
//Read your stream here
return phoneNo + " " + regId;
}
}
You can invoke it as:
using (var client = new HttpClient())
{
var stream = new StreamContent(File.OpenRead(filename));
var resp = await client.PostAsync("http://ip:port/TestService/AddUser/555111222/12345", stream);
Console.WriteLine(resp.StatusCode.ToString());
}