private static void Producers(GOshopAPISoapClient service) { var producers = service.ProducersList(); foreach (var producer in producers) { Console.WriteLine($"Producer name:{producer.ProducerName}, #{producer.ProducerId}"); } Console.WriteLine("Adding new producer"); var newListOfProducers = service.ProducerAdd($"Producer {Guid.NewGuid()}"); foreach (var producer in newListOfProducers.Where(x => !producers.Select(y => y.ProducerId).Contains(x.ProducerId))) { Console.WriteLine($"New producer added: {producer.ProducerName}, #{producer.ProducerId}"); } }
static void Main(string[] args) { var service = new GOshopAPISoapClient(); //service.Endpoint.Address = new EndpointAddress("https://www.sklepdemo.pl/Api.asmx"); using (new OperationContextScope(service.InnerChannel)) { OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = new HttpRequestMessageProperty { Headers = { { "X-GOSHOP-API-TOKEN", "768511d9c5604c2f893c28250e3b3001" } } }; ProductsListing(service); OptionsListing(service); Categories(service); Orders(service); Producers(service); Dictionaries(service); var producers = service.ProducersList(); for (var i = 0; i < 10; i++) { AddSimpleProduct(service, producers); } for (var i = 0; i < 10; i++) { AddProductWithVariants(service, producers); } StockAndPriceUpdating(service); TraitsUpdating(service); Console.ReadKey(); } }