How to read data from .net/webservice dataset.

Hi Community Members,

Have anyone ever study about msdn technical article (Talking with Navision: Accessing Navision Business Layer through a Web Service)? I’ve been trying that article, but I’m getting problem with the c/al code like below:

CC2::MessageReceived(VAR InMessage : Automation “’’.IDISPATCH”)

// load the message into an XML document and find the string node

InMsg := InMessage;

InS := InMsg.GetStream();

XMLDom.load (InS);

XMLNode := XMLDom.selectSingleNode (‘string’);

// parse the request and according to the Request variable, redirect to

// the appropriate function

ParseRequest (XMLNode.text);

CASE Request OF

’GetItem’:

BizLayer.GetItem (Parameters[1], XMLDom);

’InsertItem’:

BizLayer.InsertItem

(Parameters[1], Parameters[2], Parameters[3], Parameters[4],

Parameters[5], Parameters[6], Parameters[7], XMLDom);

ELSE

END;

// open the response queue and create a new message

MQBus.OpenWriteQueue(‘michael\private$\msdnfromnavision’,0,0);

OutMsg := CC2.CreateoutMessage(‘Message queue://michael\private$\msdnfromnavision’);

XMLDom.save (OutMsg.GetStream());

// fill the message and send it

OutMsg.Send(0);

This is the error when I try to compile the codeunit:

When the function is called, the minimum number of parameters should be used…

These are the lines of code that is having problem:

  • BizLayer.GetItem (Parameters[1], XMLDom);
  • BizLayer.InsertItem (Parameters[1], Parameters[2], Parameters[3], Parameters[4],Parameters[5], Parameters[6], Parameters[7], XMLDom);

I am really new in navision and I try to integrate .net and navision using webservice. I want to insert the data from .net using dataset into the navision before it gets to the database.

I hope the Community Members can help me on this problem.

Thank You.