public AmazonOrders() { config = new MarketplaceWebServiceOrdersConfig(); config.ServiceURL = api.ServiceURL; client = new MarketplaceWebServiceOrdersClient(api.AccessKey, api.SecretKey, api.AppName, api.AppVersion, config); operations = new OrderService(client); }
/// <summary> /// Create client. /// </summary> /// <param name="accessKey">Access Key</param> /// <param name="secretKey">Secret Key</param> /// <param name="config">configuration</param> public MarketplaceWebServiceOrdersClient(String accessKey, String secretKey, MarketplaceWebServiceOrdersConfig config) { connection = config.CopyConnection(); connection.AwsAccessKeyId = accessKey; connection.AwsSecretKeyId = secretKey; connection.LibraryVersion = libraryVersion; servicePath = config.ServicePath; }
public static void GetOrders() { // TODO: Set the below configuration variables before attempting to run // Developer AWS access key string accessKey = "AKIAJHVFTQFZLBA42KEA"; // Developer AWS secret key string secretKey = "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"; // The client application name string appName = "CSharpSampleCode"; // The client application version string appVersion = "1.0"; // The endpoint for region service and version (see developer guide) // ex: https://mws.amazonservices.com string serviceURL = "https://mws.amazonservices.com"; // Create a configuration object MarketplaceWebServiceOrdersConfig config = new MarketplaceWebServiceOrdersConfig(); config.ServiceURL = serviceURL; // Set other client connection configurations here if needed // Create the client itself Operations.Orders.MarketplaceWebServiceOrders client = new MarketplaceWebServiceOrdersClient(accessKey, secretKey, appName, appVersion, config); MarketplaceWebServiceOrdersSample sample = new MarketplaceWebServiceOrdersSample(client); // Uncomment the operation you'd like to test here // TODO: Modify the request created in the Invoke method to be valid try { IMWSResponse response = null; // response = sample.InvokeGetOrder(); // response = sample.InvokeGetServiceStatus(); // response = sample.InvokeListOrderItems(); // response = sample.InvokeListOrderItemsByNextToken(); response = sample.InvokeListOrders(); // response = sample.InvokeListOrdersByNextToken(); Console.WriteLine("Response:"); ResponseHeaderMetadata rhmd = response.ResponseHeaderMetadata; // We recommend logging the request id and timestamp of every call. Console.WriteLine("RequestId: " + rhmd.RequestId); Console.WriteLine("Timestamp: " + rhmd.Timestamp); string responseXml = response.ToXML(); Console.WriteLine(responseXml); } catch (Exception ex) { Console.WriteLine(ex.Message); throw ex; } }
/// <summary> /// Create client. /// </summary> /// <param name="accessKey">Access Key</param> /// <param name="secretKey">Secret Key</param> /// <param name="applicationName">Application Name</param> /// <param name="applicationVersion">Application Version</param> /// <param name="config">configuration</param> public MarketplaceWebServiceOrdersClient( string accessKey, string secretKey, string applicationName, string applicationVersion, MarketplaceWebServiceOrdersConfig config) { connection = config.CopyConnection(); connection.AwsAccessKeyId = accessKey; connection.AwsSecretKeyId = secretKey; connection.ApplicationName = applicationName; connection.ApplicationVersion = applicationVersion; connection.LibraryVersion = libraryVersion; servicePath = config.ServicePath; }