I have an integration that calls the ReadMultiple method of the Customer web service. There are 2 NAV databases that are supposed to be configured the same, and with similar data. However, in one database the ReadMulitple returns data as expected, but in the other database the method returns 0 records, even with no filters applied. No errors are returned.
I'm only consuming the web services, and have little knowledge of NAV, but would like to know what could cause this behaviour. Could it be part of the web service configuration, or permissions, or is there anything I can test further ?
This is NAV 2009
*This post is locked for comments
Thanks all for your help. In the end the issue was with the case of the web service name. In Test it was defined as ABC_CRM_Customer, but in Live it was ABC_CRM_CUSTOMER. This affects the case of the XML elements, and the wrapper that the .Net calling code applies was ignoring elements with the wrong case.
Due to the code structure, the easiest resolution for this was a find/replace in the reference.cs file that's generated in VS for a Service Reference, and also find/replace in the code files that used the service reference. The one final part of this fix was to ensure we still used the correct ConfigurationName in the ServiceContractAttribute
From SQL can you open that company table and check if it has any records ?
Thanks for the replies. With SetSize = -1 I still get no records, and the Read operation returns null. Again, no errors in either case.
I don't have access to NAV (it's maintained by a 3rd party, who I can ask to check things, if there's anything you can suggest ?), but can access the SQL database (though I don't have rights to enable SQL tracing)
Did you try using Read Operation to read a single customer ? Does it retrieve the customer ?
This operation does not throw faults when no matching records are present. Instead, it returns an empty record list. It might be caused by the error in C/AL code. Do you have access to NAV? Try receive the last record by setting SetSize to -1 - what would happen?
Just checked, and the company name doesn't seem to be the problem - we get the same behaviour with or without the '.', and with another company in the database. And trying a deliberately wrong company name throws an http 500 error
Any other ideas ?
Thanks for the reply. We get no error from the call. We did initially get an error 'You do not have the following permissions on CodeUnit ApplicationManagement: Execute’, but the account was then granted permissions in NAV, and we no longer get the error.
The company name might be the issue - the url we were given below includes a '.' in the name ('ABC%20LTD.') which looks a bit suspicious, and the working environment doesn't have a '.' in the name - I'll check what happens without the '.', or if I can escape it in the url
abcsqlserver.abc.local/.../ABC_CRM_CUSTOMER
Are you getting any error ? Are you querying the right company because in Navision you can have multiple companies and in your URL you need to specify the company name, make sure the company name in URL matches to the company name in the other database.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156