HttpRequestException: Response status code does not indicate success: 403 (Forbidden)

Hi,

I am using Infura API to connect to Ropsten testnet, have deployed a smart contract in Ropsten and able to Query the smart contract function that returns a view, but was not able to send a transaction through Infura API, Here is my Infura Project link
ropsten.infura.io/v3/57af8d0cb2024556b2e7af1a925ca074
Error is: Inner Exception 1:
HttpRequestException: Response status code does not indicate success: 403 (Forbidden).

At the beginning I though it is a Nethereum C# library issue, later confirmed from Library owner that it is a issue in Infura since same smart contract can be accessed through other infura project tokens.
Please help me in resolving the issue

Best regards
Puru

Surprisingly I was able to resolve this issue by removing the smart contract from White List in the Project.
Don’t know why I have to use Smart contracts white listing.

Hi @purushothamm are you able to provide us with the full body of the 403 HTTP response?

Hi @mike,
Here is the error detail.

Nethereum.JsonRpc.Client.RpcClientUnknownException
HResult=0x80131500
Message=Error occurred when trying to send rpc requests(s)
Source=Nethereum.JsonRpc.RpcClient
StackTrace:
at Nethereum.JsonRpc.Client.RpcClient.d__16.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Nethereum.JsonRpc.Client.ClientBase.<SendInnerRequestAsync>d__111.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Nethereum.JsonRpc.Client.ClientBase.<SendInnerRequestAsync>d__121.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Nethereum.JsonRpc.Client.ClientBase.<SendRequestAsync>d__81.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Nethereum.RPC.NonceServices.InMemoryNonceService.<GetNextNonceAsync>d__11.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Nethereum.Web3.Accounts.AccountSignerTransactionManager.d__16.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Nethereum.Web3.Accounts.AccountSignerTransactionManager.<SignTransactionRetrievingNextNonceAsync>d__15.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Nethereum.Web3.Accounts.AccountSignerTransactionManager.d__17.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Nethereum.Contracts.TransactionHandlers.TransactionSenderHandler1.d__3.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Nethereum.Contracts.TransactionHandlers.TransactionReceiptPollHandler1.d__3.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at BlockchainConsoleApp.Program.d__5.MoveNext() in C:\Projects and Program\Visual Studio\BlockchainConsoleApp\BlockchainConsoleApp\Program.cs:line 80

This exception was originally thrown at this call stack:
System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
Nethereum.JsonRpc.Client.RpcClient.SendAsync(Nethereum.JsonRpc.Client.RpcMessages.RpcRequestMessage, string)

Inner Exception 1:
HttpRequestException: Response status code does not indicate success: 403 (Forbidden).

Dug into this with the Nethereum team, they let me know they already connected with you to help resolve this. Please let us know if you have any additional questions.