Service Gateway: Request files

Hi!
How can I send the GetCustomerOrders request files to the OrderService.GetCustomerOrders?

If you transfer files they are first downloaded then transferred? It is possible to implement as that that it was possible to transfer a stream?

public object Any(GetCustomerOrders request)
{
    using (var orderService = base.ResolveService<OrderService>())
    {
        return new GetCustomerOrders {
            Customer = (Customer)base.ExecuteRequest(new GetCustomer {Id=request.Id}),
            Orders = orderService.Any(new QueryOrders { CustomerId = request.Id })
        };
    }
}

When you use base.ResolveService<T> you’re passing the same IRequest into the Service which will have access to the same uploaded Request.Files collection. There’s no downloading/transferring of streams.

I decided the question, thank you!

FYI I’ve added ContentType to UploadFile in this commit if needed in future which is now available from v5.1.1 on MyGet.

1 Like