/// <summary>
 /// Registers the application.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="version">The version.</param>
 /// <returns>Returns an <see cref="AppRegInfo"/>.</returns>
 public AppRegInfo RegisterApp(string name, string version, string appType)
 {
     try
     {
         var appRegInfo = new AppRegInfo {
             ModuleId = ModuleId, Name = name, Version = version, MobileAppType = appType
         };
         return(WebApi.RegisterApp(ResourceServerBaseAddress, appRegInfo, Token, RemoteHostId, ClientId, DeviceId, ModuleId, Timeout));
     }
     catch (Exception e)
     {
         Log.ErrorFormat("Himsa.Noah.MobileAccessLayer.AccessLayer::RegisterApp: {0}", e);
         throw;
     }
 }
Beispiel #2
0
 public static AppRegInfo RegisterApp(Uri resourceServerBaseAddress, AppRegInfo registrationData, Token token,
                                      string remoteHostId, string clientId, string deviceId, int moduleId, TimeSpan timeout)
 {
     try
     {
         Log.DebugFormat("Himsa.Noah.MobileAccessLayer.WebApi::RegisterApp called.");
         string path       = String.Format("api/apps");
         var    appRegInfo = Helpers.Execute <AppRegInfo, AppRegInfo>(Helpers.HttpVerb.Post,
                                                                      resourceServerBaseAddress, path, token, remoteHostId, clientId, deviceId, moduleId, registrationData,
                                                                      timeout);
         Log.DebugFormat("Himsa.Noah.MobileAccessLayer.WebApi::RegisterApp: {0} found.", appRegInfo == null ? 0 : 1);
         return(appRegInfo);
     }
     catch (Exception e)
     {
         Log.ErrorFormat("Himsa.Noah.MobileAccessLayer.WebApi::RegisterApp: {0}", e);
         throw;
     }
 }