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() { …
How to serialize objects into XML C#
I have written a simple webAPI program which returns JSON by default when running , I want the values in XML format so I tried below code it always returns string for me, have also tried multiple solution from this stackoverflow post but all returns…
Response code 400 in Asp.net core 3.1 version
I am getting 400 response code in Asp.net core web api on POST Save method Controller/Save ,i just recently upgraded .net core web api version to 3.1 [HttpPost] [ContentValidation("Shell.xsd")] [Authorize(Policy =…
Azure Identity Platform - Authenticate logged in user against Custom WebAPI Endpoint using ReactJS Client
Hi. We have a dotnet Aspnet WebAPI based API using .Net Framework 4.7.2 which we access using a ReactJs client Application. We want to authenticate users logged in as an Azure AD user against our API. Our question is as follows: How do we set up our…
CreatedAtAction doesn't work
I need to get a URL with CreatedAtAction but get a null. My searches did not yield any results. **My controller** namespace GeoService.Controllers { [Route("api/continent/{continentId}/country/{countryId}/City")] …
c# HttpClient 400 Bad Request when using https
I'm trying to get a web request working using HttpClient. It works when using http, but does not work with https. The URL I'm testing with works in a browser with both http and https, however, when using the code below it works only with http. Do I…