**Solution Found** - InfoPath 2003 - How to call a MOSS Webservice using C# and pass in a parameter - InfoPath Dev
in

InfoPath Dev

**Solution Found** - InfoPath 2003 - How to call a MOSS Webservice using C# and pass in a parameter

Last post 05-05-2009 06:19 AM by yu217171. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-05-2009 06:19 AM

    **Solution Found** - InfoPath 2003 - How to call a MOSS Webservice using C# and pass in a parameter

    Hi everyone,

    I have been searching for a week but cannot find a solution to my problem.  I am hoping that someone here can help me out.

    I have a MOSS webservice that I need to call (http://moss/_vti_bin/usergroup.asmx) and pass in a parameter (current username).  Then I would like to loop through the resultset and add the values to a drop-down list.  Can someone help me out with the code?  Thanks, much appreciated.

     yu217171

    ************************************** 

    **Update: Code Below**

    Hi everyone,

    I have found how to dynamically query a web service passing in a dynamic parameter.  Here is the code below.

    <code> 

    IXMLDOMDocument3 wsDOM =(IXMLDOMDocument3)thisXDocument.DataObjects["DataConnectionName"].DOM;

    //Set the SelectionNamespaces so that you can find the correct field
    wsDOM.setProperty("SelectionNamespaces",
                   "xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\""
                   + " xmlns:tns=\"http://schemas.microsoft.com/sharepoint/soap/directory/\"");

     //thisXDocument.UI.Alert(wsDOM.xml); <-- I used this to get the soap envelope and the xpath to the parameters and to find out which namespaces to set.

    wsDOM.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:GetUserCollectionFromGroup/tns:groupName").text = "ActionUsers"; <-- Put your variable here
    thisXDocument.DataObjects["DataConnectionName"].Query(); <-- Call the Query method to execute the webservice call

    </code>

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