Web Service Null values passed back and forth ... Xpath, XML, WebServiceConnection - InfoPath Dev
in

InfoPath Dev

Web Service Null values passed back and forth ... Xpath, XML, WebServiceConnection

Last post 10-06-2010 09:24 AM by brian.jank. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-06-2010 05:43 AM

    Web Service Null values passed back and forth ... Xpath, XML, WebServiceConnection

    I'm trying to se code to call and retieve data from web services, and I'm having the same problem with null values being passed.

     WebServiceConnection webservConn = (WebServiceConnection)DataConnections["dataConnectionName"];

                XmlDocument inputDoc = new XmlDocument();
                inputDoc.LoadXml("<EmployeeGetbyUserId xmlns=\"<webserviceurl>>" + User.UserName.ToString() + "</sUserId></EmployeeGetbyUserId>");
                XPathNavigator inputNav = inputDoc.CreateNavigator();

                XmlDocument outputDoc = new XmlDocument();
                XPathNavigator outputNav = outputDoc.CreateNavigator();

                XmlDocument errorDoc = new XmlDocument();
                XPathNavigator errorNav = errorDoc.CreateNavigator();

                webservConn.Execute(inputNav, outputNav, errorNav);

     

    Not sure if this is supposed to automatically populate the data connection fields in the form but they are blank when accessed.

    I'm using pretty much the same code to submit the retrieved data to another web service and the values are also received as null by the webservice.

    Is this an incorrect approach to using web services programmatically in infopath or am I misunderstanding the XML code i'm passing into the execution?

     

    I'm using the programmatic approach because I want to poll windows for the username before I call the web service, but still on Load (the data connection wizard only allows a static value to be passed)

  • 10-06-2010 08:28 AM In reply to

    Re: Web Service Null values passed back and forth ... Xpath, XML, WebServiceConnection

    Why not just use webservConn.Execute()  (no arguments), and use InfoPath's built-in data source access methods?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-06-2010 09:24 AM In reply to

    Re: Web Service Null values passed back and forth ... Xpath, XML, WebServiceConnection

    Because I tend to try anything except the obvious and correct solution. That worked fine, and I will be using it alot, thank you jimmy!

     I'm pretty new to infopath, sharepoint and C# but I have good knowledge of programming and C++ on an academic level. Theres alot of basic functional knowledge I'm missing, especially when it comes to using new class libraries and such.

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