XMLPort in NAV web service imports only first record

AK
Member Posts: 226
Hi,
I've exposed a NAV 2009 web service like that:
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?
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?
0
Answers
-
Can someone clarify wether or not this should work in principle?0
-
Yes, this should work.
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.0 -
Thanks, that's helpful.0
-
did you get it working? if not, please post a sample XMLMicrosoft Certified Technology Specialist
Microsoft Certified Business Management Solutions Professional
Microsoft Certified Business Management Solutions Specialist
http://www.navisiontech.com0 -
Well, kind of. Turned out it was indeed an error in the XML structure. I got that fixed, but now I run into stability problems of the web service. If the request XML is around 400 KB, the web service often, but not always responds with
<?xml version="1.0"?> -<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> -<s:Body> -<s:Fault> <faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:Microsoft.Dynamics.Nav.Types.Exceptions.NavCSideException</faultcode> <faultstring xml:lang="de-DE">There is not enough memory available on the Microsoft Dynamics NAV Server computer to peform the current activity.</faultstring> -<detail> <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">There is not enough memory available on the Microsoft Dynamics NAV Server computer to peform the current activity.</string> </detail> </s:Fault> </s:Body> </s:Envelope>
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.
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions