Hi,
I've exposed a NAV 2009 web service like that:
WriteItem(Item : XMLport "Artikel Import Webservice2") result : Text[30]
Item.IMPORT;
The XMLPort has a few lines of code to handle empty date fields, nothing else. Its properties:
Properties of the root element:
I can't upload the XML here, but it looks fine and can be validated.
It works fine for a single item, but when the incoming XML contains more than one item, only the first one is imported. It doesn't even raise an error, the additional items are just skipped. Only if there are more than exactly 194 items, a 400 Bad Request is raised.
I know this could be handled with pages as well, but I'd like to use XMLPorts, if possible. Any hints?
Answers
I have never done it with real tables, but with temporary ones it worked just fine. I therefore suggest, you test your XMLPort from a Codeunit or even running it directly from the development environment. I had it behave slightly different when run there (regarding name spaces, if i remember correctly), but generally it should work and it is easier to monitor just exactly what is fed to it.
Are you sure you don't have any SKIP or BREAK statements? Those are tricky.
Also make sure AutoSave, AutoUpdate, and AutoReplace properties are set properly.
Microsoft Certified Business Management Solutions Professional
Microsoft Certified Business Management Solutions Specialist
http://www.navisiontech.com
If the request xml gets larger, I always get this error. If I break down the request into smaller chunks, the web service works fine. I tried the hotfix 2991641 for web service memory leak, but that didn't change much.
Maybe there is a memory leak, missing clearing of variables etc.