Navision, xml and the Web

KyleaKylea Member Posts: 39
Hi all,

I have been doing some reading this morning on the site regarding url's and how to interact with the Web from Navision. I definitely have a set of training wheels on here. We are currently using V3.70 sql.

I have been assigned a project where I have to perform an online credit check for a selected customer by writing the necessary details to xml (which is new to me) and then parsing it to the www (which is also new to me) where the receiving company will then automatically parse back in xml information relating to the credit check - which I will then have to extract (new to me) and put into a report?

OK - My question is -->does anyone have any sample Navision code that might help me with the formatting in xml, the parsing to the www and most importantly the extraction of the data once it comes back from the www.

Any assistance would be sooooo appreciated.

Thanks


Kylea.

Comments

  • krikikriki Member, Moderator Posts: 9,118
    Have you searched the forum?

    There is a lot of info for writing/reading XML in 3.70.

    Also for reading/writing a webpage, there is info. Try searching for "XMLHTTP" for this part.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • DenSterDenSter Member Posts: 8,307
    There are two codeunits that you can check out in standard Navision that will show you exactly how to create and receive XML Documents. These codeunits are part of Commerce Gateway, and are numbers 99008517 (XML Document-Create) and 99008518 (XML Document-Transform). Never mind the process that it follows, but look at how the XML object model is used.
  • KyleaKylea Member Posts: 39
    OK,

    I have done some reading and had a little experiment with some code. I managed to get some information off the web by using the following code.


    //'xmlHTTP' is 'Microsoft XML, v4.0'.XMLHTTP40
    //'domDoc' is 'Microsoft XML, v4.0'.DOMDocument40
    //'domNode' is 'Microsoft XML, v4.0'.IXMLDOMNode


    CREATE(xmlhttp);
    xmlhttp.open('GET','http://www.mibuso.com/rss/?feed=2',FALSE);
    xmlhttp
    xmlhttp.send;

    Domdoc := xmlhttp.responseXML;
    Domnode := Domdoc.selectSingleNode('//rss/channel/item/title');
    Domdoc.save('C:\Temp\Mibusotest.xml');
    MESSAGE(Domnode.text);

    CLEAR(Domnode);
    CLEAR(Domdoc);
    CLEAR(xmlhttp);


    I suppose my issue is now that I am not sure of the syntax for the MS XML parser - in this case it does a GET not sure what I have to do to place an xml file out to a web address. I will do a search on XML Parser to see if I can find some definitions.

    Also I would like to look at Codeunit 99008517 and 99008518 but unfortunately our licence does not cover objects in this range.

    I am struggling with the whole concept of actually putting a file on the web and getting another one back. I suppose I am going to go through a very big learing curve in the next few weeks.

    Any information is much appreciated.


    Kylea :)
  • Soft_TodSoft_Tod Member Posts: 43
    Also I would like to look at Codeunit 99008517 and 99008518 but unfortunately our licence does not cover objects in this range.

    If you just want to look into this CUs, you can copy one at the time in the object designer to a object number you may access and rename it.
    It is impossible to make anything foolproof, because fools are so ingenious.
  • KyleaKylea Member Posts: 39
    Ok thankyou for that I will do that.

    We had a new staff member start who knows .NET so now I am tending toward this way as I believe Navision is going in this direction.

    Can anyone tell me how I define Navision to call out to the .NET application :? - and if you do explain can you keep it very simple as I am new to this part. ie. how do I define the automation?

    Thanks


    Kylea
  • krikikriki Member, Moderator Posts: 9,118
    Kylea wrote:
    Can anyone tell me how I define Navision to call out to the .NET application :? - and if you do explain can you keep it very simple as I am new to this part. ie. how do I define the automation?
    For the moment Navision cannot call .NET directly. You have to write a DDL that can be called from Navision and this DLL can call .NET.
    There is also information on MIBUSO about it.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • DenSterDenSter Member Posts: 8,307
    Don't forget though that if you want to integrate something with Navision that you will have to program Navision to deal with the resulting XML document, regardles of whether or not you have a .NET app doing the most sophisticated things for you :). So you may win something on the .NET side because it's cool to work on, but you will also have two apps to maintain.
  • KyleaKylea Member Posts: 39
    Thanks everyone for your input. It is really great....

    I am going to start simply and see how I go. I am sure there will be more questions on the way.

    I got a good article yesterday about .NET and Navision so anyone who is interested it is here.

    http://www.mibuso.com/dlinfo.asp?FileID=353

    I have had a read and it is all new to me but will read each bit slowly and hopefully will get a good solution.

    Thanks


    Kylea
  • RoelofRoelof Member Posts: 377
    I have actually the same question as Kylea, but for HTML instead of XML.
    Has anyone and idea or maybe some example code?

    Thanks,
    Roelof.
    Roelof de Jonghttp://www.wye.com
  • SavatageSavatage Member Posts: 7,142
    Webcast
    Are you looking for a way to exchange information between different systems in a streamlined way? Attend this webcast to learn how the XMLPorts Objects built into Microsoft® Navision® allow for greater compatibility through efficient handling of document exchange between other systems.
    http://www.mibuso.com/dlinfo.asp?FileID=422
    Import
    I got some e-mails with some question about how to import XML file into Navision. So here's a little codeunit with xml file that describes how to import a XML file into Navision. You'll need the 'Microsoft XML, version 2.0' which should be automatically available when installing Navision. At least all attain versions. This codeunit is written in Navision 3.70, but you can probably use it in version before that.
    http://www.mibuso.com/dlinfo.asp?FileID=329
    Export
    With Xml Export for Navision 3.70 you can export anything to xml from Navision. Xml Export comes with links and filters as you know from the Navision report designer.
    http://www.mibuso.com/dlinfo.asp?FileID=285
    Step By Step XML sample
    http://www.microsoft.com/technet/techne ... fault.aspx
    XML & SQL
    http://www.microsoft.com/technet/techne ... fault.aspx
Sign In or Register to comment.