문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top