This document was generated from CDN thread Created by: Salim Guerid on 07-09-2013 01:32:26 AM Hi All,I am getting the error "The request failed with HTTP status 401: Unauthorized." when posting AXL request in C# on the RisPort. The strange thing is that I have no problem using within the AXL interface with the same user, password and CUCM. I generated the RISService using the WSDL and updatd the connection as follow:1 public RISService(string ccmIp, string user, string password)
2{
3System.Net.ServicePointManager.CertificatePolicy = newBruteForcePolicy();
4this.Url = "https://" + ccmIp + ":8443/realtimeservice/services/RisPort"; 5this.Credentials = new System.Net.NetworkCredential(user, password);
6// this.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap11;
7}
I have then added: 1protectedoverride System.Net.WebRequest GetWebRequest(Uri uri)
2{
3System.Net.HttpWebRequest request = base.GetWebRequest(uri) as System.Net.HttpWebRequest;
4request.ProtocolVersion = System.Net.HttpVersion.Version10;
5// request.PreAuthenticate = true;
6return request;
7}
8
9publicclassTrustAllCertificatePolicy : System.Net.ICertificatePolicy
10{
11public TrustAllCertificatePolicy() { }
12publicbool CheckValidationResult(ServicePoint sp, X509Certificate cert, WebRequest req, int problem)
13{
14returntrue;
15}
16}
The SOAP monitor is never able to check any request when opening the https://<CCMIP>:8443/realtimeservice/SOAPMonitorYour help will be greatly appreciated.Some doc used to troubleshoot:http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/devguide/8_0_1/serviceability.html#wp1053517http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_tech_note09186a0080a962c4.shtmlSubject: RE: C# > 401: Unauthorized Replied by: Salim Guerid on 07-09-2013 08:57:15 AMOk, I was sure that was an obvious mistake...
As clearly indicated by the error code, I just needed to the add the right role to the AXL user: Standard RealtimeAndTraceCollection.