public static async Task <SalesOrderServiceCreateResponse> Call(AxdSalesOrder order) { SalesOrderServiceClient client = new SalesOrderServiceClient(); AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false); return(await client.createAsync(order)); }
public ActionResult Index(SalesOrderModel model) { var client = new SalesOrderServiceClient(); var sales = client.GetSales(model.StartDate, model.EndDate, model.Name).ToList(); model.Items = sales; return(View(model)); }
public ActionResult Detail(string id) { var model = new SalesOrderModel(); if (!string.IsNullOrEmpty(id)) { var salesOrderID = int.Parse(id); if (salesOrderID > 0) { var client = new SalesOrderServiceClient(); var orderDetails = client.GetSalesOrderDetailBySalesOrderID(salesOrderID).ToList(); model.Items = orderDetails; } } return(View(model)); }
private static void AddWCFServices(this IServiceCollection services, IConfiguration configuration) { services.AddScoped<IAddressTypeService>(provider => { var client = new AddressTypeServiceClient( new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue }, new EndpointAddress(configuration["AddressTypeAPI:Uri"]) ); return client; }); services.AddScoped<IContactTypeService>(provider => { var client = new ContactTypeServiceClient( new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue }, new EndpointAddress(configuration["ContactTypeAPI:Uri"]) ); return client; }); services.AddScoped<ICountryService>(provider => { var client = new CountryServiceClient( new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue }, new EndpointAddress(configuration["CountryAPI:Uri"]) ); return client; }); services.AddScoped<ICustomerService>(provider => { var client = new CustomerServiceClient( new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue }, new EndpointAddress(configuration["CustomerAPI:Uri"]) ); return client; }); services.AddScoped<ISalesOrderService>(provider => { var client = new SalesOrderServiceClient( new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue }, new EndpointAddress(configuration["SalesOrderAPI:Uri"]) ); return client; }); services.AddScoped<ISalesPersonService>(provider => { var client = new SalesPersonServiceClient( new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue }, new EndpointAddress(configuration["SalesPersonAPI:Uri"]) ); return client; }); services.AddScoped<ISalesTerritoryService>(provider => { var client = new SalesTerritoryServiceClient( new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue }, new EndpointAddress(configuration["SalesTerritoryAPI:Uri"]) ); return client; }); services.AddScoped<IStateProvinceService>(provider => { var client = new StateProvinceServiceClient( new BasicHttpsBinding { MaxReceivedMessageSize = int.MaxValue }, new EndpointAddress(configuration["StateProvinceAPI:Uri"]) ); return client; }); }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(SalesOrderServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpsBinding_ISalesOrderService)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(SalesOrderServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpsBinding_ISalesOrderService)); }
public SalesOrderServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(SalesOrderServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public SalesOrderServiceClient(EndpointConfiguration endpointConfiguration) : base(SalesOrderServiceClient.GetBindingForEndpoint(endpointConfiguration), SalesOrderServiceClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public SalesOrderServiceClient() : base(SalesOrderServiceClient.GetDefaultBinding(), SalesOrderServiceClient.GetDefaultEndpointAddress()) { this.Endpoint.Name = EndpointConfiguration.BasicHttpsBinding_ISalesOrderService.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }