I'm getting the following error:
Client found response content type of 'text/html; charset=UTF-8', but expected 'application/soap+xml'.
I don't know why? Any ideas? Here's my code:
public string switch_action()
{
string rtn = "";
Avaya.AvayaAES_SMS.SystemManagementService sms = new Avaya.AvayaAES_SMS.SystemManagementService();
// define the authentication...
ICredentials credentials = new NetworkCredential("aesadmin@localhost", "aesadmin");
sms.Credentials = credentials;
sms.PreAuthenticate = true;
try
{
rtn += "Starting...\n";
rtn += "Initiating Web Services request...\n";
// user agent info...
string temp = sms.UserAgent;
rtn += "UserAgent = " + temp + "\n";
// define the URL...
sms.Url = "http://localhost:8080/sms/getModelClasses.php";
string url = sms.Url;
rtn += "URL = " + url + "\n";
sms.SoapVersion = SoapProtocolVersion.Soap12;
string soapversion = sms.SoapVersion.ToString();
rtn += "soapversion = " + soapversion + "\n";
Avaya.AvayaAES_SMS.Result result = sms.submitRequest("Station", "list", "", "count 5", "Extension|Name|Type|Port");
}
catch (Exception ex)
{
rtn += "An Exception occurred!! Details Below:\n";
rtn += ex.Message;
}
return rtn;
}
|