Streamed XML data to Node Set - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Streamed XML data to Node Set

Last post 09-08-2011 07:16 AM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-07-2011 01:31 PM

    • bblanke
    • Top 500 Contributor
      Male
    • Joined on 11-12-2009
    • Milwaukee, WI
    • Posts 32

    Streamed XML data to Node Set

    I'm trying to take data I have streamed from an XML source, acquired through C# code from web service not available in soap, and place that data into a node set to be used in a drop-down. I've been able to get the data from the xml and into a string array. Now I'm stuck and don't know how to get it from the array to a node set.
    Brandon Blanke
    Technical Analyst / Quad Graphics
    Filed under: , , ,
  • 09-07-2011 03:07 PM In reply to

    Re: Streamed XML data to Node Set

    I think the way to do this is to create an XML file with the same format as the XML you're retrieving, then import that as an XML file secondary data source and use that as the source for your dropdown.

    Then when you call your web service, just copy the XML you receive into that data source and replace its contents.  No need to convert it into an array first.

     And just FYI, InfoPath 2010 has built-in functionality for querying REST web services, if that's what you're using.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-08-2011 06:00 AM In reply to

    • bblanke
    • Top 500 Contributor
      Male
    • Joined on 11-12-2009
    • Milwaukee, WI
    • Posts 32

    Re: Streamed XML data to Node Set

    I'm using Infopath 2007, do you have any sample code (C#) I can use to import the XML as a data source?
    Brandon Blanke
    Technical Analyst / Quad Graphics
  • 09-08-2011 07:16 AM In reply to

    Re: Streamed XML data to Node Set

    Creating a data source doesn't require code.  You just create a file with the XML you want, and go through the data source connection wizard.

    In your code, you would need to use this.DataSources["dataSourceName"].CreateNavigator() to create an XPathNavigator, and you would use this to swap out its contents with the result of your web service call.  I'm afraid I don't have any code samples for this.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.