Web Services Black Belt: consuming NAV web services using pure C/AL

  • Post comments:142 Comments
  • Reading time:5 mins read

MP900406779[1]Have you ever needed to connect to the Web services of one NAV instance from another one? If so, I bet that the approach was something like this: you created a .NET class where you defined a Web or Service reference to the target instance, and then you consumed that .NET class using .NET Framework interoperability. It was kind of clumsy, inflexible, but it worked.

How cool would it be if you could do something like this:

WITH WebService DO BEGIN
  CONNECT(‘http://localhost:7047/DynamicsNAV70/WS/CRONUS%20International%20Ltd/Page/Customer’);

  INIT;
  SETVALUE(‘Name’,’Test Customer’);
  SETVALUE(‘Blocked’,Cust.Blocked::Ship);
  SETVALUE(‘Credit_Limit_LCY’,10000);
  CREATE;

  MESSAGE(‘I just created Customer No. %1 in another NAV instance.’,GETVALUE(‘No’));
END;

(more…)

Continue ReadingWeb Services Black Belt: consuming NAV web services using pure C/AL