Hello,
I have a Web Service (GetADUsers) that I use As a Data Connection to Get a list of Users. The Web Service has four columns: AccountName, Email, Domain, DisplayName. I bound the Data Connection to a Drop Down (AccountName as Value, DisplayName as Display). When I the User selection is changed I need to get the Email and Domain for this User. I tried to set up a rule on the Drop Down, but I am always getting the first item in the list. I then tried to pull the data using code (VB.NET) as follows:
-********************************************************************
Dim NameSpaces As String = "xmlns:dfs='http://schemas.microsoft.com/office/infopath/2003/dataFormSolution'" &
"xmlns:dsf='http://schemas.microsoft.com/office/infopath/2003/dataFormSolution'" & _
" xmlns:tns='http://tempuri.org/Users.xsd'" & _
" xmlns:i0='http://tempuri.org/Users.xsd'"
Dim doc As IXMLDOMDocument3 = thisXDocument.DataObjects("GetADUsers").DOM
doc.setProperty("SelectionNamespaces", NameSpaces)
Dim AccountName As String = thisXDocument.DOM.selectSingleNode("//my:User").text
'Get the selected node
Dim selectedNode As DOMNode = doc.selectSingleNode( _
"/dfs:myFields/dfs:dataFields/tns:GetADUsersResponse/tns:GetADUsersResult/i0:Users/i0:User[AccountName='" & AccountName & "']" & _
"/i0:Domain")
-********************************************************************
And I get nothing for the selectedNode.
If I use Only the
doc.selectSingleNode("/dfs:myFields/dfs:dataFields")
I get the fields.
I Tried many versions of the "GetADUsersResponse" section, i.e. tns:GetADUsersResponse, i0:GetADUsersResponse, GetADUsersResponse but I always get nothing. My xml file looks like this:
-********************************************************************
<?xml version="1.0" encoding="utf-8" ?>
- <Users xmlns="http://tempuri.org/DirectoryServices/ADUsers">
- <xs:schema id="Users" targetNamespace="http://tempuri.org/Users.xsd" xmlns:mstns="http://tempuri.org/Users.xsd" xmlns="http://tempuri.org/Users.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
- <xs:element name="Users" msdata:IsDataSet="true">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="User">
- <xs:complexType>
- <xs:sequence>
<xs:element name="DisplayName" type="xs:string" minOccurs="0" />
<xs:element name="Domain" type="xs:string" minOccurs="0" />
<xs:element name="AccountName" type="xs:string" minOccurs="0" />
<xs:element name="Email" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
- <Users xmlns="http://tempuri.org/Users.xsd">
- <User diffgr:id="User1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
<DisplayName>Bates, Aaron</DisplayName>
<Domain>DomainName</Domain>
<AccountName>AccountName</AccountName>
<Email>Email</Email>
</User>
-********************************************************************
Would love to hear suggestions to resolve this issue. You can email me to:
[email protected]Thanks!
Sharone Shani.