Webservices in Dynamics NAV 2009

hsilveirahsilveira Member Posts: 23

I'm implementing a new project where i have to receive orders from a portal. Until today when i have to receive xml files from other applications i use MS-QUEUE and NAS and no problem with that. Now, with NAV 2009 we have Web services functionality and i'm trying to populate one codeunit as webservice but i don't know how to receive that xml message. That xml message will have header and lines. Any ideas that can help me?

Thanks in advance




  • Options
    jlandeenjlandeen Member Posts: 524
    Depending on the version of NAV 2009 that you are runinng (2009, SP1, or R2) you have different options.

    The cleanest one that I find easy to work with is to use bigtext as the input parameter of a codeunit and then send that bigtext to an XML Port - that process works for all 3 flavours of NAV 2009. I find this works really well with XSD based classes in .NET and I generate serializable class structures in c# - you then serialize or de-serialize any xml documents flowing to NAV.

    R2 (I'm not sure about SP1) allows you to specify an XML port natively as a function parameter.

    The reason I like building XSD based classes is that I can then use them as part of any business/data logic in a web application that is easily transmitted to NAV - it's important that you build your XML Ports in NAV to match the XSD's!!

    (for those of you who don't know what XSD is - hit up google, look for xml schema definition)
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

  • Options
    hsilveirahsilveira Member Posts: 23
    Hi Jeff,

    Thank you for your tips. While waiting for some help i googled and found your suggestion for Dynamics NAV 2009 R2:

    "R2 (I'm not sure about SP1) allows you to specify an XML port natively as a function parameter."

    Once again, thank you for your help.


    Hugo Silveira

  • Options
    davmac1davmac1 Member Posts: 1,283
    Do you have control of the web portal?
    With the application tier, you can call functions in codeunits and pass them parameters. These parameters are defined fields in the parameter list of the codeunit in Navision. I have coded the functions on the Navision side for .net developers, and from the Navision side it is pretty straightforward.
  • Options
    hsilveirahsilveira Member Posts: 23
    Maybe you can help in another issue.

    i already have a XML port as a function parameter and available as webservice. Can i, at the beginnig of Navision process, save data to a xml file?


Sign In or Register to comment.