The following code works fine when called from a web application. When the same wrapper code is called from within a webservice (on the same host), the call fails with the above error. I just confirmed that the API is working at the moment from the utility.
The webservice belongs to a client who won’t let us talk to their technical people; everything has to be filtered through somebody with no technical knowledge, and they are unwilling to convey any information from their technical team back to us: If something is broken, just keep trying every day until you find it’s fixed. Turnaround is usually about a week.
For that reason, I’d like to get this resolved without their involvement. Since the exact same code works right now if I call it from a different executable on the same host, I have some confidence that this may be possible.
var payload = "{""JSON"": ""stuff""}";
var request = HttpWebRequest.Create(url) as HttpWebRequest;
request.Method = "POST";
WriteStringToStream(request.GetRequestStream(), payload);
string encoded = System.Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1")
.GetBytes(MMAPIUserName + ":" + MMAPIPassword));
request.Headers.Add("Authorization", "Basic " + encoded);