Question

I am just curious about this. I am making a change in this project, that is using NetSuite web service, and sometimes it throws a SoapException at random, "Only one request may be made against a session at a time".

    private NetSuiteService _service;

    SessionResponse response = _service.login(passport); //if SoapException, retries??
    Status status = response.status;

Reference.cs:
    public partial class NetSuiteService : 
System.Web.Services.Protocols.SoapHttpClientProtocol

My question is: If I am in debug mode, I trace this, and I hit F5, and it seems to automatically retry after exception is thrown (the code keeps running, with no try catch block implemented, no while loop) until successful (status.isSuccess == true). When I run it in release mode, as a windows service, the log shows it stops running after exception is thrown.

How is this possible? Is it better to catch this exception in a try catch block and retry?

Was it helpful?

Solution

NS Server refuses a request if its already processing one from the same user.

If you want to make sure that your request succeeds than you have to catch this exception and retry.

OTHER TIPS

This was not the experience I had. We thought this related to netsuite sessions but turned out to be nothing to do with that at all and in fact was not even hitting netsuite (according to netsuite log)​​. Turned out we were trying to execute too many commands in a single request and it totally refused to send it to netsuite. Never seen this error before, may be it is a new thing with the new version!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top