You have specified that your formatter will be triggered for the following request Content-Type
headers:
SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/xml"));
SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/xml"));
But you haven't set them in the request. That's why your custom formatter is never trigerred. So once you register it in the global configuration:
config.Formatters.Insert(0, new iOSDeviceXmlFormatter());
You should make sure that you are setting the proper request Content-Type
header:
string data = "<iOSDevice>xml_goes_here</iOSDevice>";
using (WebClient client = new WebClient())
{
// That's the important part that you are missing in your request
client.Headers[HttpRequestHeader.ContentType] = "text/xml";
var result = client.UploadString(url, "PUT", data);
}
Now the following action will be trigerred:
public void Put(string id, iOSDevice model)
{
}
and of course your custom formatter will be invoked before in order to instantiate your iOSDevice
from the request.