503 error in after deploying in task scheduler(production only).Its not replication from Local development server/Code

prasad k 86 Reputation points
2021-09-23T05:00:21.693+00:00

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 jsonpar = JsonConvert.SerializeObject(new
                {
                    param= objorders
                });

                var url = config.weburl;

                var stringContent1 = new StringContent(jsonpar , Encoding.UTF8, "application/json");


                var apiResponse1 = client.PostAsync('http://10.xxxxx/web/xxxx', stringContent1 )
                if(apiResponse1 .result.issuucesscode)

{
}

But when deploying same code to task scheduler in server, getting below response.

Error:ServiceUnavailableStatusCode: 503, Reason Phrase: 'Service Unavailable', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Pragma: no-cache Proxy-Connection: Keep-Alive Connection: Keep-Alive Cache-Control: no-cache Content-Length: 859 Content-Type: text/html; charset=utf-8 }

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,997 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
341 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Duane Arnold 3,211 Reputation points
    2021-09-23T11:06:49.953+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.