Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Web Services

Reply
Developer
Posts: 58
Registered: ‎01-14-2010
My Device: 9000
My Carrier: Rogers

BAA to find central push server and SRP ids

Hi

 

Can BAA be used to find out the SRP ids of the BES instances in a BES domain?

Can it also be used to find the central push server for a BES domain?

If yes, what service should I be using?

 

Thanks, Any comments are appreciated.

 

Developer
Developer
Posts: 18
Registered: ‎06-01-2011
My Device: 9800
My Carrier: Rogers

Re: BAA to find central push server and SRP ids

Hi.

 

You can find some SRP information by doing a findServices:

 

findServices findServicesRequest = newfindServices();

findServicesRequest.includeSettings = true;

findServicesRequest.locale = "en_US";

 

findServicesResponsefindServicesResponse = coreWebService.findServices(findServicesRequest);

 

FindServicesResultservicesResult = findServicesResponse.returnValue;

 

if (servicesResult.findServicesReturnStatus.code != FindServicesReturnStatusEnumType.SUCCESS)

{

Console.WriteLine("Error occurred: "+ servicesResult.findServicesReturnStatus.message);

 

return;

}

ServiceType dispatcherService = null;

 

for (intj = 0; j < servicesResult.services.Length; j++)

{

if (servicesResult.services[j].GetType().Equals(typeof(DispatcherService)))

{

dispatcherService = servicesResult.services[j];

break;

}

}

if (dispatcherService == null)

{

Console.WriteLine("Dispatcher Service not found");

 

return;

}

findServiceInstancesByService findServiceInstancesByServiceRequest = newfindServiceInstancesByService();

findServiceInstancesByServiceRequest.serviceId = dispatcherService.serviceId;

findServiceInstancesByServiceRequest.locale = "en_US";

findServiceInstancesByServiceRequest.includeStatus = false;

findServiceInstancesByServiceRequest.loadServiceConsumerRelationships = false;

findServiceInstancesByServiceRequest.loadServiceProducerRelationships = false;

findServiceInstancesByServiceRequest.includeExtendedData = true;

 

findServiceInstancesByServiceResponsefindServiceInstancesByServiceResponse = coreWebService.findServiceInstancesByService(findServiceInstancesByServiceRequest);

 

FindServiceInstancesByServiceResultserviceInstanceResult = findServiceInstancesByServiceResponse.returnValue;

 

if (serviceInstanceResult.findServiceInstancesByServiceReturnStatus.code != FindServiceInstancesByServiceReturnStatusEnumType.SUCCESS)

{

Console.WriteLine("Error occurred: "+ serviceInstanceResult.findServiceInstancesByServiceReturnStatus.message);

 

return;

}

for (intj = 0; j < serviceInstanceResult.serviceInstances.Length; j++)

{

if (serviceInstanceResult.serviceInstances[j].GetType().Equals(typeof(DispatcherHostServiceInstance)))

{

DispatcherHostServiceInstanceType junk = serviceInstanceResult.serviceInstances[j] asDispatcherHostServiceInstance;

 

Console.WriteLine("SRP key: "+ junk.SRPKey);

 

Console.WriteLine("SRP Status: "+ junk.SRPStatus);

 

Console.WriteLine("User count: "+ junk.userCount);

 

Console.WriteLine("name: "+ junk.name);

}

}

 

 

 

Let me know if this helps.

 

Kevin

 

 

Click "Accept as Solution" if your problem is solved. To give thanks, click on the KUDOS STAR
Developer
Developer
Posts: 18
Registered: ‎06-01-2011
My Device: 9800
My Carrier: Rogers

Re: BAA to find central push server and SRP ids

Hi.

 

I have expanded on my code to include information about the MDS service:

 

findServices

findServicesRequest = newfindServices();

findServicesRequest.includeSettings = true;

findServicesRequest.locale = "en_US";

 

findServicesResponsefindServicesResponse = coreWebService.findServices(findServicesRequest);

 

FindServicesResultservicesResult = findServicesResponse.returnValue;

 

if (servicesResult.findServicesReturnStatus.code != FindServicesReturnStatusEnumType.SUCCESS)

{

Console.WriteLine("Error occurred: "+ servicesResult.findServicesReturnStatus.message);

 

return;

}

ServiceType dispatcherService = null;

 

ServiceType MDSService = null;

 

for (intj = 0; j < servicesResult.services.Length; j++)

{

if (servicesResult.services[j].GetType().Equals(typeof(DispatcherService)))

{

dispatcherService = servicesResult.services[j];

Console.WriteLine("Found DispatcherService");

}

if (servicesResult.services[j].GetType().Equals(typeof(MDSCSService)))

{

MDSService = servicesResult.services[j];

Console.WriteLine("Found MDSService");

 }

}

if (dispatcherService == null)

{

Console.WriteLine("Dispatcher Service not found");

 

return;

}

findServiceInstancesByService findServiceInstancesByServiceRequest = newfindServiceInstancesByService();

findServiceInstancesByServiceRequest.serviceId = dispatcherService.serviceId;

findServiceInstancesByServiceRequest.locale = "en_US";

findServiceInstancesByServiceRequest.includeStatus = false;

findServiceInstancesByServiceRequest.loadServiceConsumerRelationships = false;

findServiceInstancesByServiceRequest.loadServiceProducerRelationships = false;

findServiceInstancesByServiceRequest.includeExtendedData = true;

 

findServiceInstancesByServiceResponsefindServiceInstancesByServiceResponse = coreWebService.findServiceInstancesByService(findServiceInstancesByServiceRequest);

 

FindServiceInstancesByServiceResultserviceInstanceResult = findServiceInstancesByServiceResponse.returnValue;

 

if (serviceInstanceResult.findServiceInstancesByServiceReturnStatus.code != FindServiceInstancesByServiceReturnStatusEnumType.SUCCESS)

{

Console.WriteLine("Error occurred: "+ serviceInstanceResult.findServiceInstancesByServiceReturnStatus.message);

 

return;

}

for (intj = 0; j < serviceInstanceResult.serviceInstances.Length; j++)

{

if (serviceInstanceResult.serviceInstances[j].GetType().Equals(typeof(DispatcherHostServiceInstance)))

{

DispatcherHostServiceInstanceType DispatcherInfo = serviceInstanceResult.serviceInstances[j] asDispatcherHostServiceInstance;

 

Console.WriteLine("\nSRP INFORMATION");

 

Console.WriteLine("SRP key: "+ DispatcherInfo.SRPKey);

 

Console.WriteLine("SRP Status: "+ DispatcherInfo.SRPStatus);

 

Console.WriteLine("User count: "+ DispatcherInfo.userCount);

 

Console.WriteLine("Dispatcher name: "+ DispatcherInfo.name);

}

}

findServiceInstancesByService findServiceInstancesByServiceRequest2 = newfindServiceInstancesByService();

findServiceInstancesByServiceRequest2.serviceId = MDSService.serviceId;

findServiceInstancesByServiceRequest2.locale = "en_US";

findServiceInstancesByServiceRequest2.includeStatus = false;

findServiceInstancesByServiceRequest2.loadServiceConsumerRelationships = false;

findServiceInstancesByServiceRequest2.loadServiceProducerRelationships = false;

findServiceInstancesByServiceRequest2.includeExtendedData = true;

 

findServiceInstancesByServiceResponsefindServiceInstancesByServiceResponse2 = coreWebService.findServiceInstancesByService(findServiceInstancesByServiceRequest2);

 

FindServiceInstancesByServiceResultserviceInstanceResult2 = findServiceInstancesByServiceResponse2.returnValue;

 

if (serviceInstanceResult2.findServiceInstancesByServiceReturnStatus.code != FindServiceInstancesByServiceReturnStatusEnumType.SUCCESS)

{

Console.WriteLine("Error occurred: "+ serviceInstanceResult2.findServiceInstancesByServiceReturnStatus.message);

 

return;

}

for (intj = 0; j < serviceInstanceResult2.serviceInstances.Length; j++)

{

if (serviceInstanceResult2.serviceInstances[j].GetType().Equals(typeof(MDSCSServiceInstance)))

{

MDSCSServiceInstanceType MDSinfo = serviceInstanceResult2.serviceInstances[j] asMDSCSServiceInstance;

 

Console.WriteLine("\nMDS INFORMATION");

 

Console.WriteLine("Installed on: "+ MDSinfo.installedMachine.hostName);

 

Console.WriteLine("MDS service name: "+ MDSinfo.name);

 

Console.WriteLine("MDS status: "+ MDSinfo.status);

}

}

Click "Accept as Solution" if your problem is solved. To give thanks, click on the KUDOS STAR