Submit whole XML to WebService - InfoPath Dev
in

InfoPath Dev

Submit whole XML to WebService

Last post 11-23-2008 10:16 PM by Shiva. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-20-2008 04:32 AM

    • zartr
    • Not Ranked
    • Joined on 11-04-2008
    • Posts 15

    Submit whole XML to WebService

    When using Dataconnections I can submit the whole Xml. My web service takes an XmlDocument as an argument. That's working fine.
    However I need to submit to the webservice from within code.

    The XmlParser I wrote relies on XmlDocument. So here's my question. How do get the Infopath "XmlDocument" in code behind?

    The only way to get the data seems to be XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();
    That's where I'm stuck. I don't want an XPathNavigator.. I need the whole XmlDocument :-/

  • 11-20-2008 05:51 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Submit whole XML to WebService

    Hello,

    Here is the code to get the xml document,

    XmlDocument newDoc = new XmlDocument();

    newDoc.LoadXml("< Input XML>");

    or

    newDoc.Load("<File Name>");

  • 11-20-2008 06:25 AM In reply to

    Re: Submit whole XML to WebService

    Hello zartr,

    I think this will work:

    XmlDocument doc = new XmlDocument();
    doc.LoadXml(MainDataSource.CreateNavigator().InnerXml);
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-21-2008 04:15 AM In reply to

    • zartr
    • Not Ranked
    • Joined on 11-04-2008
    • Posts 15

    Re: Submit whole XML to WebService

    InnerXML is a string.. that scared me in the first place. Also there were a lot of tabs and linebreaks in that Property (\n\t\t...).
    But it's working quite fine. Thank you!

  • 11-23-2008 10:16 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Submit whole XML to WebService

    Hello,

    InnerXml return type is string and it contains the data as HTML nodes. It is giving the \n, \t characters.

    \n -> Specifies the followed node is start in new line.

    \t -> Specifies it will take tab space between words.

    While creating the node or XmlDocument it will works for us without giving any error. Above characters works like escape characters.

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.