How can I pass an XML document back thorugh web service?

jwilderjwilder Member Posts: 263
edited 2009-03-09 in NAV Three Tier
We have a website that will call a NAV Codeunit to return a customer record. We want to return this Customer record in an xml format? How can I do this?

I don't think an xmlport is the answer because an xmlport only returns access to the fields in the xmlport, it doesn't return the actual xml that I can see. Or is there a way to expose the xmlport as xml instead?

Comments

  • ara3nara3n Member Posts: 9,256
    what version of NAV?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jwilderjwilder Member Posts: 263
    NAV 2009 using the External Connector. You posted on another question of mine that I can use xml dom. I am guessing I can use xmldom document as var parameter in Navision codeunit? This way I could pass in an xml document and pass it back.
  • ara3nara3n Member Posts: 9,256
    You use xmldom to consume a webservice, not to offer a webservice. You can't use xmldom as a function parameter in you webservice. You need to use xmlport.
    If your goal is to see how the xml looks like. well run the xmlport and export it to text.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jwilderjwilder Member Posts: 263
    My goal is to pass actual xml to website. It is easier for our website to work with actual xml.
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    XMLport as a ByRef (changeable) parameter.

    This compiles as a custom class in C# (or something like that) but you could just write a C# method in your website that serializes those back to XML.

    Or, use XMLDOM (MSXML6.0) to make an XML and put into a ByRef BigText, but the above is better IMHO.
Sign In or Register to comment.