public void registerMessagingServiceScopes(String consumerKey, String scope) throws Exception
{
HttpClient client = new HttpClient();
PostMethod method = new PostMethod(ConsumerScopesRegistrationURL);
method.addRequestHeader(new Header("Authorization", "OpenId " + SubscriberOpenIdIdentifier));
method.addParameter(OAuth.OAUTH_CONSUMER_KEY, consumerKey);
method.addParameter("xoauth_scope", scope);
method.addParameter("xoauth_permission", "sendMessages");
int status = client.executeMethod(method);
if (HttpResponseCodes.SC_OK != status) {
throw new RuntimeException("Scopes can not be registered");