Hi,
Can someone help me if possible? We have a system were the existing code for v4.0.3.23305 build works except for a bug where data with an & (ampersand) value in a field removes the remainder of the data after the & in the field. We know that nassql build 4.0.3.26565 fixes this exe bug, but when sending messages back out of Navision using this new build again we get the errors:
"The Stream has returned a write error." and then
The call to member Send Failed. MSMQBusAdapter.MSMQBusAdapter.1 returned the following message: There is insufficient memory to perform the operation on the stream.
A sample of the code is here:
B2BSetup.GET;
IF ISCLEAR(MQBus) THEN
CREATE(MQBus);
IF ISCLEAR(Cc2) THEN
CREATE(Cc2);
IF ISCLEAR(OutMsg) THEN
CREATE(OutMsg);
IF ISCLEAR(XMLDoc) THEN
CREATE(XMLDoc);
Cc2.AddBusAdapter(MQBus,1);
MQBus.OpenWriteQueue(B2BSetup."MSMQ Acknowledgement",0,0);
OutMsg := Cc2.CreateoutMessage('Message [url=Queue://']Queue://'[/url] + B2BSetup."MSMQ Acknowledgement");
OutS := OutMsg.GetStream;
B2BMessageHeader2.RESET;
B2BMessageHeader2.SETRANGE(Type,B2BMessageHeader.Type);
B2BMessageHeader2.SETRANGE(MessageID,B2BMessageHeader.MessageID);
B2BMessageHeader2.SETRANGE(MessageGUID,B2BMessageHeader.MessageGUID);
B2BMessageHeader2.SETRANGE(TrackingGUID,B2BMessageHeader.TrackingGUID);
CASE B2BMessageHeader.MessageID OF
B2BSetup."New Order Ack.",
B2BSetup."New Customer Ack":
BEGIN
TempB2BSetup.INIT;
TempB2BSetup."Temp BLOB".CREATEOUTSTREAM(OutS2);
CLEAR(XMLSendAck);
XMLSendAck.SETTABLEVIEW(B2BMessageHeader2);
XMLSendAck.SetMessageID(B2BMessageHeader.MessageID);
XMLSendAck.SETDESTINATION(OutS2);
XMLSendAck.EXPORT;
TempB2BSetup.CALCFIELDS("Temp BLOB");
IF TempB2BSetup."Temp BLOB".HASVALUE THEN BEGIN
TempB2BSetup."Temp BLOB".CREATEINSTREAM(InS2);
XMLDoc.load(InS2);
// Write Log
B2BLog.INIT;
B2BLog.MessageGUID := B2BMessageHeader.MessageGUID;
B2BLog.TrackingGUID := B2BMessageHeader.TrackingGUID;
B2BLog.Type := B2BLog.Type::Ack;
B2BLog."Created by" := USERID;
B2BLog."Created at" := CURRENTDATETIME;
B2BLog.MessageID := B2BMessageHeader.MessageID;
B2BLog."File Content".CREATEINSTREAM(InS2);
XMLDoc.save(InS2);
XMLDoc.save(OutS);
OutMsg.Send(0);
B2BLog.INSERT;
END;
END;
END;
Many Thanks in advance to anyone who can come up with a solution.
...
The answer was to clear the automation variables first.
0
Answers
http://xml.silmaril.ie/authors/specials/
So in your xmlport you need to check if there is an & and if yes you need to add
amp;
For example
<CustName>Barnes & Noble</CustName>
shoudl change
<CustName>Barnes & Noble</CustName>
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n