/// <summary> /// Creates new instance from the store client. /// </summary> /// <param name="subscriptionId">The Windows Azure subscription id</param> /// <param name="storeEndpointUri">The service management endpoint uri</param> /// <param name="cert">The authentication certificate</param> /// <param name="logger">The logger for http request/response</param> /// <param name="serviceManagementChannel">The service management channel</param> public StoreClient( string subscriptionId, string storeEndpointUri, X509Certificate2 cert, Action <string> logger, IServiceManagement serviceManagementChannel) { Validate.ValidateStringIsNullOrEmpty(storeEndpointUri, null, true); Validate.ValidateStringIsNullOrEmpty(subscriptionId, null, true); Validate.ValidateNullArgument(cert, Resources.NullCertificateMessage); this.subscriptionId = subscriptionId; headersInspector = new HeadersInspector(); storeChannel = ServiceManagementHelper.CreateServiceManagementChannel <IStoreManagement>( ConfigurationConstants.WebHttpBinding(0), new Uri(storeEndpointUri), cert, new HttpRestMessageInspector(logger), headersInspector); this.serviceManagementChannel = serviceManagementChannel; MarketplaceClient = new MarketplaceClient(); }
/// <summary> /// Creates new instance from the store client. /// </summary> /// <param name="subscriptionId">The Windows Azure subscription id</param> /// <param name="storeEndpointUri">The service management endpoint uri</param> /// <param name="cert">The authentication certificate</param> /// <param name="logger">The logger for http request/response</param> /// <param name="serviceManagementChannel">The service management channel</param> public StoreClient( string subscriptionId, string storeEndpointUri, X509Certificate2 cert, Action<string> logger, IServiceManagement serviceManagementChannel) { Validate.ValidateStringIsNullOrEmpty(storeEndpointUri, null, true); Validate.ValidateStringIsNullOrEmpty(subscriptionId, null, true); Validate.ValidateNullArgument(cert, Resources.NullCertificateMessage); this.subscriptionId = subscriptionId; headersInspector = new HeadersInspector(); storeChannel = ChannelHelper.CreateServiceManagementChannel<IStoreManagement>( ConfigurationConstants.WebHttpBinding(0), new Uri(storeEndpointUri), cert, new HttpRestMessageInspector(logger), headersInspector); this.serviceManagementChannel = serviceManagementChannel; MarketplaceClient = new MarketplaceClient(); }