« Back to Serviceability XML Questions

How Can use ControlCenterServices in C#

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
How Can use ControlCenterServices in C#
servicecontrol .net controlcenterservices soapgetservicestatus
Answer
5/15/12 11:39 AM
I want to via ControlCenterServices get the CUCM service status.
my code like this:
ServicePointManager.CertificatePolicy = new SSL();
ControlCenterServices s = new ControlCenterServices();
ServicePointManager.Expect100Continue = false;
ICredentials credentials = new NetworkCredential("admin", "Pass1234");
s.Credentials = credentials;
s.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap11;
string[] a = new string[1];
a[0] = "Cisco Tftp";
s.RequestEncoding = System.Text.Encoding.UTF8;
//s.UseDefaultCredentials = true;
//s.Url = "192.168.32.9";
//ControlServiceRequest c = new ControlServiceRequest();
//c.ControlType=ControlType.
ServiceInformationResponse response = new ServiceInformationResponse();
response = s.soapGetServiceStatus(a);
 
but there are error at last line.
 
Dose anybody konw why .
thanks.

Unfortunately there is a known limitation of the .NET WSDL consumer in that it does not support the 'RPC/encoded' WSDL style that the ControlCenterServicesPort uses.  You can work around this by using the interface at the XML level rather than the SOAP level, which is not too difficult as the schema is quite small/simple.