Problem using UserProfileService - InfoPath Dev
in

InfoPath Dev

Problem using UserProfileService

Last post 06-11-2007 10:00 AM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-09-2007 10:28 PM

    Problem using UserProfileService

    My InfoPath form contain a Data Connection to a SharePoint web service:

    http://<MyServer>/_vti_bin/UserProfileService.asmx?WSDL

    In my code (in the OnLoad event) I try to operate this Data Connection by this code:

    function XDocument::OnLoad(eventObj)

    {

    var objNetwork = new ActiveXObject("WScript.network");

    var currentLogin=objNetwork.UserDomain+"\\" +objNetwork.UserName ;

    if(XDocument.IsNew) {

    var dataObj=XDocument.DataObjects("GetUserProfileByName");

    var dataDom=dataObj.DOM;

    dataDom.setProperty("SelectionNamespaces", 'xmlns:dfs=http://schemas.microsoft.com/office/infopath/2003/dataFormSolution xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" ' );

    dataDom.selectSingleNode ("/dfs:myFields/dfs:queryFields/s0:GetUserProfileByName/s0:AccountName").text=currentLogin ;

    dataObj.Query();

    } 

    }

    I try to put "currentLogin" as parameter of the web service, But I get error that:

    Reference to undeclared namespace prefix:'s0' .

    When I watch the field's tree of this Data Connection (named "GetUserProfileByName") in the Data Source view I have:

    MyFields -> queryFields -> s0:GetUserProfileByName -> AccountName.

     

    What is the problem in my code???

     

  • 06-11-2007 10:00 AM In reply to

    Re: Problem using UserProfileService

    The problem lies in this line:

    dataDom.setProperty("SelectionNamespaces", 'xmlns:dfs=http://schemas.microsoft.com/office/infopath/2003/dataFormSolution xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" ' );

    You never set the s0 namespace.

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