Exceeds the size of the string buffer - sending XML via TCP

drstakz
Member Posts: 30
Hello everybody,
pls can you help me?
I created codeunit for sending xml to my other application (.NET). With smaller xml i haven't problem, communication is OK. But if I try send larger xml, NAV return error "The length of the string exceeds the size of the string buffer".
For communication i used navision communication component 2 (CC2) and Navision Socket Bus Adapter (SBA). Other variable are OutMsg : CC2.Outmessage, OutS : OutStream, xmlout : XmlDocument
my code:
Some idea, pls?? Is it possible send xml document direct to CC2.OutMessage without normal outstream ?? or? ..
Very thanks for help
pls can you help me?
I created codeunit for sending xml to my other application (.NET). With smaller xml i haven't problem, communication is OK. But if I try send larger xml, NAV return error "The length of the string exceeds the size of the string buffer".
For communication i used navision communication component 2 (CC2) and Navision Socket Bus Adapter (SBA). Other variable are OutMsg : CC2.Outmessage, OutS : OutStream, xmlout : XmlDocument
my code:
IF ISCLEAR(CC2) THEN CREATE(CC2); IF ISCLEAR(xmlout) THEN CREATE(xmlout); IF ISCLEAR(SBA) THEN CREATE(SBA); CC2.AddBusAdapter(SBA, 0); xmlout.load(FORMAT('C:\temp\c.xml')); // load large xml OutMsg:= CC2.CreateoutMessage('Sockets://192.168.1.1:3000'); OutS:= OutMsg.GetStream(); OutS.WRITE(xmlout.xml); // here is problem with xml size OutMsg.Send(0);
Some idea, pls?? Is it possible send xml document direct to CC2.OutMessage without normal outstream ?? or? ..
Very thanks for help
0
Comments
-
So OK,
small change was necessary.xmlout.save(OutS);
instead OutS.WRITE(xmlout.xml);0 -
NAV texbuffer before NAV2013 was 1024. When you passing your xml as string to your automation it hit the text buffer which causing error (the same will be with variant datatype). You need to find a way how to pass your xml to your automation not using text buffer.
You could look to ADO Stream, but not sure - never used CC2... What else metods got your automation? What datatypes it can accept?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