Problem using UserProfileService! - InfoPath Dev
in

InfoPath Dev

Problem using UserProfileService!

Last post 06-14-2007 02:07 AM by Matt Faus. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-07-2007 03:07 AM

    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-14-2007 02:07 AM In reply to

    Re: Problem using UserProfileService!

    Hi liorlankril,

    The problem is that you are using the s0 namespace, but you did not define it in your setProperty() call.  Take a look at this blog post for more information: http://www.infopathdev.com/blogs/matt/archive/2006/02/02/Setup-Namespaces-for-a-Secondary-Data-Source.aspx

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.