InfoPath cannot create a new, blank form error

O

OMAF-Terry

Exact error message is:
====================================
The following DataObject either cannot be created or cannot be initialized:
gUserFullName3
The query cannot be run for the following DataObject: gUserFullName3
InfoPath cannot run the specified query.
The SOAP response indicates that an error occurred on the server:

Server was unable to process request. --> The (SAMAccountName=) search
filter is invalid.
====================================

Code from IndoPath onLoad (C#):
====================================
IXMLDOMDocument3 wsDOM =
(IXMLDOMDocument3)thisXDocument.DataObjects["gUserFullName3"].DOM;
wsDOM.setProperty("SelectionNamespaces","xmlns:dfs=\"http://localhost/getUserInfo_June10_Ver1/\"
" + "xmlns:s0=\"http://localhost/getUserInfo_June10_Ver1/\"")
wsDOM.selectSingleNode("/dfs:myFields/dfs:queryFields/s0:getCurrentUsrFullName/s0:localUsername").text = strUserName;
thisXDocument.DataObjects["gUserFullName3"].Query();
string queryValue =
wsDOM.selectSingleNode("/dfs:getCurrentUserFullNameResponse/s0:getCurrentUserFullNameResult").ToString();
thisXDocument.UI.Alert("queryValue:"+ queryValue);
====================================

C# web service method:
====================================
[WebMethod (Description="Get the full name of the form user.")]
public string getCurrentUserFullName(string localUserName)
{
DirectoryEntry entryFullName = new
DirectoryEntry("LDAP://ou=people,dc=on,dc=ca");
DirectorySearcher dsFullName = new DirectorySearcher(entryFullName);
dsFullName.Filter = "(SAMAccountName=" + localUserName + ")";
dsFullName.PropertiesToLoad.Add("givenName");
dsFullName.PropertiesToLoad.Add("sn");
SearchResult resultFullName = dsFullName.FindOne();

if(resultFullName == null)
{
return "Error finding user " + localUserName + " in Active Directory.";
}

string strCurrentUserFullName =
resultFullName.Properties["givenName"][0].ToString() + " " +
resultFullName.Properties["sn"][0].ToString();
return strCurrentUserFullName;
}
====================================


What am I doing wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top