CLEAR(CC2); CLEAR(MqBUS); CREATE(CC2); CREATE(MqBUS); CC2.AddBusAdapter(MqBUS,1); MqBUS.OpenWriteQueue('.\Private$\fromnavision',0,0); OutMsg := CC2.CreateoutMessage('Message queue://'); IF ISCLEAR(XmlDom) THEN CREATE(XmlDom); XMLDOMManagement.SetNormalCase; XMLProccesingInst := XmlDom.createProcessingInstruction('xml','version=''1.0'' encoding=''utf-8'''); XMLCurrNode := XmlDom.appendChild(XMLProccesingInst); CLEAR(XMLCurrNode); XMLCurrNode := XmlDom.createElement('ResponseXml'); XmlDom.appendChild(XMLCurrNode); IF vEntity='SellToCustomerNo' THEN BEGIN Customer.FIND('-'); REPEAT XMLCurrNode2 := XMLCurrNode.ownerDocument.createNode('element', 'Entity', ''); XMLCurrNode2.text:='SellToCustomerNo'; XMLCurrNode.appendChild(XMLCurrNode2); IF XMLDOMManagement.AddElement(XMLCurrNode,'Values','','',XMLCurrNode)>0 THEN EXIT; ParentNode := XmlDom.createElement('Value'); XMLCurrNode.appendChild(ParentNode); Node := XmlDom.createElement('Code'); Node.text:=Customer."No."; ParentNode.appendChild(Node); Node := XmlDom.createElement('Description'); Node.text:=Customer.Name; ParentNode.appendChild(Node); UNTIL Customer.NEXT=0; END; OutS := OutMsg.GetStream(); OutS.WRITE(XmlDom.xml); OutMsg.Send(0);
Length of the text string exceeds the size of the string buffer
Comments
I suggest using xmlports
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I cannot turn the debugger on as I am using the NAS to detect the output. Also the project where I am using this code , is using only XML Doms , not XML Ports.
What I am tying to is to fill up a combo box in a front end (designed in .net), which on getting loaded is generating an Xml file hthat is detected by the NAS . This XML contains informations regarding a request to Navision to supply all the customers in an XML format . The codeunit which I have designed is doing this.....it is generating an XML file forwarded to MSMQ, which is going to picked up by a web service, which parses the XML to decode the customfer nos and fill up the comobo box. But I am getting the error the moment I am sending the XML Document to MSMQ. The XML document is really a very big one, as it contains a huge list of customers .
Can you suggest me , how can O come around this problem.
Systems Analyst,
MBS Dynamics.
I cannot turn the debugger on as I am using the NAS to detect the output. Also the project where I am using this code , is using only XML Doms , not XML Ports.
What I am tying to is to fill up a combo box in a front end (designed in .net), which on getting loaded is generating an Xml file hthat is detected by the NAS . This XML contains informations regarding a request to Navision to supply all the customers in an XML format . The codeunit which I have designed is doing this.....it is generating an XML file forwarded to MSMQ, which is going to picked up by a web service, which parses the XML to decode the customer nos and fill up the combo box. But I am getting the error the moment I am sending the XML Document to MSMQ. The XML document is really a very big one, as it contains a huge list of customers .
Can you suggest me , how can I come around this problem ?
Systems Analyst,
MBS Dynamics.
//Your issue is line bellow.
OutS.WRITE(XmlDom.xml);
you need to changeit.
XmlDom.save(OutS);
OutMsg.Send(0);
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
thanks a lot........ it worked !!! \:D/
Systems Analyst,
MBS Dynamics.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
it worked , but still it is giving a strange error..... in MSMQ I am getting only a pert of it . Say for example, if there are 90 customers in my customer table, in MSMQ I am getting a XML of only 6 customers out of it ! Can you suugest me , how can I come around this ?
Systems Analyst,
MBS Dynamics.
I don't know enough about message queue to know the exact cause. This must be a memory setup limit somewhere. try to google it.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Henrik Frederiksen, Denmark
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
How about changing the codepage - is that possible (from UTF-8 to UTF-16 for instance)?
Henrik Frederiksen, Denmark
You are referring to Encoding not codepage. Yes it's possible to change the codepage, asumming the xml file is in that encoding.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
...Yes, I was talking about the encoding (XML is new to me(!))....
How can I easily do this...I am trying to use a "aEncConv"-program from
http://dynamicsuser.net/blogs/nunomaia/ ... ter-2.aspx
Don't know if there is an easier way than to start saving files to disc and then load again...?
Thx in advance for your time...
Henrik Frederiksen, Denmark