Options

Repeated web service call always causes same error

Anatoliy_EAnatoliy_E Member Posts: 5
edited 2014-08-20 in NAV Three Tier
Dear All,

I am working on integration with NAV via OData/SOAP. My .NET app using autogenerated clients. Everything is ok with system services (http://myNav.com:7047/MyNavServer/WS/SystemService or http://myNav.com:7048/MyNavServer/OData requesting "Company" entity), but when I am trying to call something company related (e.g. http://myNav.com:7048/MyNavServer/OData ... y('MyComp')) several times, only the first call is successful, second throws an exception

System.Data.Services.Client.DataServiceQueryException : An error occurred while processing this request.
----> System.Data.Services.Client.DataServiceClientException : <?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code /><m:message xml:lang="en-US">There is no Active Session within the filter.

Filters: Server Instance ID: 1029, Session ID: 434</m:message></m:error>
at System.Data.Services.Client.DataServiceRequest.Execute(DataServiceContext context, QueryComponents queryComponents)
at System.Data.Services.Client.DataServiceQuery`1.Execute()
at System.Data.Services.Client.DataServiceQuery`1.GetEnumerator()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray(IEnumerable`1 source)
at CRM.DevX.Tests.Integration.Nav.Odata.CompanyInformationClientTests.CompanyInformationService_SingleRequest(String companyName) in CompanyInformationClientTests.cs: line 16
at CRM.DevX.Tests.Integration.Nav.Odata.CompanyInformationClientTests.CompanyInformationService_MultipleSequentalRequests_UsingPersonalClients(String companyName) in CompanyInformationClientTests.cs: line 28
--DataServiceClientException
at System.Data.Services.Client.QueryResult.ExecuteQuery()
at System.Data.Services.Client.DataServiceRequest.Execute(DataServiceContext context, QueryComponents queryComponents)

Several requests made sequentially are possible only if there is a 15-20 sec delay between them. I've tried using same client instance for all the requests and separate for every request, same exception.
The same situation with SOAP services.
What I am doing in a wrong way. Please help.

Comments

  • Options
    Anatoliy_EAnatoliy_E Member Posts: 5
    solved

    OnAfterGetRecord trigger of Company Information page runs following code when System Indicator is "Company + Database" :
    ActiveSession.SETRANGE("Session ID",SESSIONID);
    ActiveSession.FINDFIRST;
    

    The code causes the error.

    At Company Information page edit form I've changed System Indicator field value from "Company + Database" to "Company".
Sign In or Register to comment.