failed to send msmq with C/AL Call be webservice (nav2009)

seanfuyunseanfuyun Member Posts: 2
edited 2013-11-06 in NAV Three Tier
I can send msmq in classic client ,but when i call the function to send msmq via webservice (nav 2009),it gives me a error that
"This message is for C/AL programmers: The call to member Send failed: parameter is error。"
my codeunit is very easy like this:
Name	DataType	Subtype	Length
OutMsg	Automation	'Navision Communication Component version 2'.OutMessage	
MQBus	Automation	'Navision MS-Message Queue Bus Adapter'.MSMQBusAdapter	
SBA	        Automation	'Navision Socket Bus Adapter'.SocketBusAdapter
CC2	        Automation	'Navision Communication Component version 2'.CommunicationComponent	
XMLDom	Automation	'Microsoft XML, v3.0'.DOMDocument	

IF ISCLEAR(MQBus) THEN CREATE(MQBus);
IF ISCLEAR(CC2) THEN CREATE(CC2);
IF ISCLEAR(XMLDom) THEN CREATE (XMLDom);
MQBus.RemoveWhenCommit(FALSE);
CC2.AddBusAdapter(MQBus,1);

msmqName :='dmsap2\msmqtest';
MSMQLogEntry.GET(1);
MSMQLogEntry.CALCFIELDS("Message Info");
MSMQLogEntry."Message Info".CREATEINSTREAM(_Ins);
XMLDom.load(_Ins);
MQBus.OpenWriteQueue(msmqName,0,0);
OutMsg := CC2.CreateoutMessage('Message queue://'+msmqName);
XMLDom.save (OutMsg.GetStream());
OutMsg.Send(0);
the .net code is like this
            msmqtest service = new msmqtest();
            service.UseDefaultCredentials = true;
            service.send();
Table 【MSMQLogEntry】 is developed by myself,the field "message info" is a bolb field,it saves the XML files.
the error is on [OutMsg.Send(0);] i think maybe XMLDOM.save(OutMsg.GetStream()) save anything in outmsg so it give the error paramenter is error.

how can i deal with it. thank you!
Sign In or Register to comment.