Author Message
ArthurBales
Joined: Jul 24, 2007
Messages: 0
Offline
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;
}
AnthonyGreway
Joined: Feb 12, 2007
Messages: 0
Offline
Hi Arthur,

You are most likely seeing this error message because the server is returning "HTTP 404 - File not found" html error. It appears like you are using http://localhost:8080/sms/getModelClasses.php as the entry point to the SMS web service which is not correct. Try using this as the entry point to the SMS web service http://localhost/sms/SystemManagementService.php

Also just an FYI - the SMS web service does not run under Tomcat so it will not be found under port 8080. I also noticed that you are running this app on the localhost? is this correct? AES does not support co-resident applications on the server.

Hope this helps,

Tony
ArthurBales
Joined: Jul 24, 2007
Messages: 0
Offline
Thanks for your help! You're right - the AES server is not really on localhost. I'm using TcpTrace as an intermediary to see the raw SOAP values going back and forth. I'm redirecting the traffic to the real AES server machine from the TcpTrace program. And changing the target to SystemManagementService.php worked in the sense that I now have new errors! Namely:
Unsupported encoding, use one of ISO-8859-1, US-ASCII, UTF-8

Do you know how I should set this value properly? I've tried the following unsuccessfully:
// define the encoding
sms.RequestEncoding = System.Text.Encoding.UTF8;
Go to:   
Mobile view