Extract values from ADservice using VB.net - InfoPath Dev
in

InfoPath Dev

Extract values from ADservice using VB.net

Last post 09-09-2007 10:02 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-15-2007 08:17 PM

    Extract values from ADservice using VB.net

    Using Infopath 2007 and Qdabra ADservice, I would like to extract Active directory values (GetMyInfo) as string variables, using the 'FormEvents_Loading'

    event within VB.net, so I can use those values for further code. Would anyone know how to do this?

     

    Thanks

  • 09-09-2007 10:02 PM In reply to

    Re: Extract values from ADservice using VB.net

    (From my e-mail on 8/15)

    I don't think we have any specific posts or articles that have code snippets (the purpose is to be codeless!), but it should be pretty easy to do this. Here's some random ideas (note: the code won't compile since you need to fill in values):

     

    Dim dataObj as DataObject

    Dim dataDom As IXMLDOMDocument2

    Dim nodeEntry As IXMLDOMNode

     

    dataObj = thisXDocument.DataObjects("GetUserInfo")

     

    ' Cast the DOM to a DOMDocument2 to access setProperty dataDom = dataObj.DOM dataDom.setProperty("SelectionLanguage", "XPath") dataDom.setProperty("SelectionNamesapces", _ "http://schemas.microsoft.com/office/infopath/2003/Template" & _  """ xmlns:tns=""http://qdabra.com/webservices"")

     

    ' select the query parameters of the web service nodeEntry = dataObj.DOM.selectSingleNode( "/myFields/queryFields/tns:GetUserInfo")

    ' Assign values to each relevant parameter nodeEntry.selectSingleNode("tns:username").text = "<your alias>"

     

    dataObj.Query()

     

    nodeResult = dataObj.DOM.selectSingleNode( "/myFields/dataFields/tns:GetUserInfoResponse/GetUserInfoResult/ADProp")

    ' do filtering for desired value

    ' ...

     

    Hope this gets you going in the right direction!

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.