Web API addCustomer service faced error when connecting Azure Cosmos DB
System.InvalidOperationException: Unable to resolve service for type 'Microsoft.Azure.Cosmos.CosmosClient' while attempting to activate 'CosmosWebAPI.Controllers.CosmosDbService'. I got the above exceptions when running the below api service in local…
Transfer data between SQL database servers securely by end to end service
Hi We have two SQL server databases in two different location that belongs to two different companies. I want to transfer a few table data (about a million records) from source database server to destination (Master) server. (Cumulative data of 30…
System.OperationCanceledException: The operation was canceled.
Good Day All i have the following code, that randomly throws the following error System.OperationCanceledException: The operation was canceled. // HttpClient is intended to be instantiated once per application, rather than per-use. See Remarks. static…
Misused header name. Make sure request headers are used with HttpRequestMessage, response
Good Day all i have the following code // HttpClient is intended to be instantiated once per application, rather than per-use. See Remarks. static readonly HttpClient httpClient = new HttpClient(); public async Task<List<USERS>>…
Java.Net.SocketException: Software caused connection abort
Good Day All i have the following code and it randomly gives an error on Android 11 Java.Net.SocketException: Software caused connection abort , not all the time , App Centre Reported it twice public async Task<List<USERS>> Get_All_Customers(…
Javax.Net.Ssl.SSLHandshakeException: Trust anchor for certification path not found.
i have tested my SSL against https://www.digicert.com/help/ and got a green Light "Congratulations! This certificate is correctly installed." and my api's get this error Javax.Net.Ssl.SSLHandshakeException: Trust anchor for certification path…
Java.Net.SocketException: Socket closed
Good Evening Everyone im calling a web api function like this public async Task<List<USERS>> Get_All_Customers( ) { List<USERS> results = null; try { USERS m_model = new…
Using IHttpActionResult Put Verb
I was wondering where does my client calling ajax get the ID to send to the IHttpActionResult Put Verb Action Method? I am accustomed to calling the api with the ID in the url like so /api/Product/id function productUpdate(product) { …
503 error in after deploying in task scheduler(production only).Its not replication from Local development server/Code
Calling one api http://10.xxx.xxx.xx:xx/web/services/xxxxx with json list as a parameter, It working from local machine (c# program and postman also). using (var client = new HttpClient()) { try { var…
How to get data directly from request.form.file[0] instead of copying it to server ?
I work on c# 7 I face issue I can't get data from file Request.form.file[0] directly it must copying to server to get data from it so can i get data from variable DisplayFileName instead of get data from input path after copying to server below is my…
Using Gmail And Web Api To Send Email Failing
I am currently busy with a Web Api allication that sends emails using the credentials from my gmail account. I have the following in my webconfig file <mailSettings> <smtp from = "mygmailemailaddress" > <network…
C# - Making sync function to async
Hi, I am just wondering if below code changes (New Code) make any difference in performance with respective to calling cosmos from a web api Old Code: public string GetDocs() { return JsonConvert.SerializeObject(CreateDocumentQuery().ToList());…
Web Api Still Getting Cors Errors After Installing Microsoft.AspNet.Cors And Enabling Cors On Controller
I am buildind a Web Api app locally and I am calling the methods using simple jQuery ajax method calls. As per the title I have installed the Microsoft.AspNet.Cors package via nuget and enabled cors in my WebApiConfig.cs and on my controller like this …
c# Asp Web API: HttpException: Maximum request length exceeded.
This might be a common question, but my situation is not so common. I an sending a serialized image into an Asp.net Web API method and am getting this error: System.Web.HttpException: Maximum request length exceeded. at…
Conversion from .NET framework 4.6 to 4.8
I have converted my web api framework target from 4.6.2 --> 4.8, this is the error I get after I change target framework and reinstalling nuget packages:- The type initializer for 'System.Web.Http.GlobalConfiguration' threw an exception.. error…
Request help on connecting webapi from azure relay
Hi Team, We need some help on the below enhancement. We have an existing asp.net webapi hosted in iis. We are using mysql as a backend. We need to use azure relay-mostly hybrid connection, to call the webapi. Note: we don't want…
ASP.NET Web API: Mock authorization, headers in Unit Test
Hi All, I have to mock the authorization and headers while calling controller action in the Unit test method. ValueController.cs ( ASP.Net Web Api(.Net Framework 4.6.1) Public async Task<HttpResponseMessage> ValueProcessMessageAsync() { …
Select only few columns from a table to map with Odata Select query on C# Web API
We have a table in the database which has multiple columns. We only want a query which will return only requested columns. These requested columns will from Odata Select Query requested using C# Web API. For Example, I have an EmployeeTable which has…
Passing an Interface as a parameter to Web API method
Hi All, I would like to know how can I pass an interface as a parameter to a Web API method. Here's my interface: public interface IPerson { string Gender { get; set; } decimal Weight { get; set; } } I am sending this information…
Web api hosting
Hello everyone, I am new to web api. I have this simple question about web api host. So here is how a client application consume the web api: public class StudentController : Controller { // GET: Student public ActionResult Index() { …