I could use some help for a tcp wrapper for NAV2013

Sunset
Member Posts: 201
With the absence of the old automations, I find myself in need of a few hints for a tcp wrapper/listener for NAV2013.
Background: I send a XML file to an internal port, and will recieve an (String) answer back from another program on how the xml was handled.
For sending the xmlfile I have
This works like a charm. The other program recieves everything it needs, and responds. And so my problem begins. No matter how I try to get the response it ends in tears
I've tried with StreamReader, NetStream, straight from TcpClient but it just won't read the string i get returned. The closest I've got is with
netStream.Read(dnBytes, 0, TcpClient.ReceiveBufferSize); //dnBytes is System.Byte
but then it stops no matter how I try to get the byte to a string ](*,)
Any suggestions would be appreciated
Background: I send a XML file to an internal port, and will recieve an (String) answer back from another program on how the xml was handled.
For sending the xmlfile I have
IF ISNULL(TcpClient) THEN TcpClient := TcpClient.TcpClient; //System.Net.Sockets.TcpClient TcpClient.Connect("Network IP", Network Port"); Writer := Writer.StreamWriter(TcpClient.GetStream); //Writer is System.IO.StreamWriter // Write info about the file that is going to be sent Writer.Write('Document info here'); Writer.Write(''); Writer.Write(''); IF ISNULL(XMLDOM) THEN XMLDOM := XMLDOM.XmlDocument; XMLDOM.Load(XMLFilename); Writer.Write(XMLDOM.OuterXml); Writer.Flush;
This works like a charm. The other program recieves everything it needs, and responds. And so my problem begins. No matter how I try to get the response it ends in tears

I've tried with StreamReader, NetStream, straight from TcpClient but it just won't read the string i get returned. The closest I've got is with
netStream.Read(dnBytes, 0, TcpClient.ReceiveBufferSize); //dnBytes is System.Byte
but then it stops no matter how I try to get the byte to a string ](*,)
Any suggestions would be appreciated
Don't just take my word for it, test it yourself
0
Comments
-
I am not sure if it matches your needs, but you could take a look at NAV2015, codeunit 1290 "Web Service Request Mgt." which does much of the same.Bardur Knudsen
Microsoft - Dynamics NAV0
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