<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Web Services</title><link>https://www.infopathdev.com:443/forums/48.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: AD Web Service Solution</title><link>https://www.infopathdev.com:443/forums/thread/28082.aspx</link><pubDate>Mon, 21 Apr 2008 11:15:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28082</guid><dc:creator>zeroecho</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28082.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=28082</wfw:commentRss><description>&lt;p&gt;Will this method find a manager&amp;#39;s email address? If I pass it the AD value &amp;quot;manager&amp;quot; and am expecting to get that user&amp;#39;s email back, and set the &amp;quot;returnedvalue&amp;quot; to be &amp;quot;mail&amp;quot;&amp;nbsp; I just get error of &amp;quot;There is no such object on the server&amp;quot; so either my LPAD string is wrong, or I&amp;#39;m using your method wrong :)&lt;/p&gt;</description></item><item><title>Re: AD Web Service Solution</title><link>https://www.infopathdev.com:443/forums/thread/26756.aspx</link><pubDate>Tue, 26 Feb 2008 14:05:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26756</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26756.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=26756</wfw:commentRss><description>&lt;p&gt;the using statement/reference you need to add&amp;nbsp;should be System.DirectoryService.&lt;/p&gt;</description></item><item><title>Re: AD Web Service Solution</title><link>https://www.infopathdev.com:443/forums/thread/26711.aspx</link><pubDate>Mon, 25 Feb 2008 13:52:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:26711</guid><dc:creator>zeroecho</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/26711.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=26711</wfw:commentRss><description>&lt;p&gt;I am interested in how to get the Manager&amp;#39;s email address from AD to add to my form so that when I send an email from the form it goes to the rigth person for approval.&lt;/p&gt;
&lt;p&gt;I am currently using the Context and ResolvePrinciples technique to populate the user&amp;#39;s name and department fields (though that seems to have broken when I moved from WSS to MOSS...)&lt;/p&gt;
&lt;p&gt;I keep reading you need to use Webservices to access AD directly from c# code... I already have my project set up to do custom submitting and don&amp;#39;t really want to change my project type. Do you know the c# &amp;quot;using...&amp;quot; reference I need to talk directly to AD or to query a user&amp;#39;s profile from MOSS?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;</description></item><item><title>Re: AD Web Service Solution</title><link>https://www.infopathdev.com:443/forums/thread/21285.aspx</link><pubDate>Wed, 27 Jun 2007 06:08:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21285</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21285.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=21285</wfw:commentRss><description>Ahhhhhhh I am sorry for the formatting but I saw that there have been user users facing the / similar problems already. Sometimes every line gets duplicated many times and sometimes the above happens. Hope you can still ready it.</description></item><item><title>Re: AD Web Service Solution</title><link>https://www.infopathdev.com:443/forums/thread/21283.aspx</link><pubDate>Wed, 27 Jun 2007 06:03:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21283</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21283.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=21283</wfw:commentRss><description>Yes of course. I usually use it to receive all necessary information regarding a user when he/she opens the form (e.g. name, manager, department...) I usually call the Web Service in the OnLoad event using code and pass the credentials I want to receive as a string delimeted with &amp;quot;-&amp;quot;. Actually it was planned to pass a complex type (string array) to the Web Service but somehow I couldn&amp;#39;t manage this. May be someone knows how to do this. But anyway below is sample code you could use in your InfoPath template to get the users name and department. var obj = new ActiveXObject(&amp;quot;WScript.NetWork&amp;quot;); var login = obj.UserName; var whatToGet = &amp;quot;name-department&amp;quot;; var objWSDataObject = XDocument.DataObjects(&amp;quot;User Service&amp;quot;); objWSDataObject.DOM.setProperty(&amp;quot;SelectionNamespaces&amp;quot;, &amp;#39;xmlns:dfs=&amp;quot;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&amp;quot; xmlns:tns=&amp;quot;http://tempuri.org/&amp;quot;&amp;#39;); objWSDataObject.DOM.selectSingleNode(&amp;quot;dfs:myFields/dfs:queryFields/tns:getUserInfo/tns:account&amp;quot;).text = login; objWSDataObject.DOM.selectSingleNode(&amp;quot;dfs:myFields/dfs:queryFields/tns:getUserInfo/tns:whatToPass&amp;quot;).text = &amp;quot;samaccountname&amp;quot;; objWSDataObject.DOM.selectSingleNode(&amp;quot;dfs:myFields/dfs:queryFields/tns:getUserInfo/tns:whatToGet&amp;quot;).text = whatToGet; objWSDataObject.Query(); XDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:Name&amp;quot;).text = objWSDataObject.DOM.selectSingleNode(&amp;quot;dfs:myFields/dfs:dataFields/tns:getUserInfoResponse/tns:getUserInfoResult/tns:string[1]&amp;quot;).text; XDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:department&amp;quot;).text = objWSDataObject.DOM.selectSingleNode(&amp;quot;dfs:myFields/dfs:dataFields/tns:getUserInfoResponse/tns:getUserInfoResult/tns:string[2]&amp;quot;).text;</description></item><item><title>Re: AD Web Service Solution</title><link>https://www.infopathdev.com:443/forums/thread/21254.aspx</link><pubDate>Tue, 26 Jun 2007 14:23:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21254</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21254.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=21254</wfw:commentRss><description>&lt;p&gt;Hi nukkumatti,&lt;/p&gt;&lt;p&gt;This looks interesting - could you tell us a little about situations where it is useful and, also, how to use it?&lt;/p&gt;</description></item><item><title>AD Web Service Solution</title><link>https://www.infopathdev.com:443/forums/thread/21203.aspx</link><pubDate>Mon, 25 Jun 2007 14:38:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21203</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21203.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=21203</wfw:commentRss><description>&lt;p&gt;So here goes the Web Service&lt;/p&gt;&lt;p&gt;public string[] getUserInfo(string account, string whatToPass, string whatToGet)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;string delimStr = &amp;quot;-&amp;quot;;&lt;br /&gt;&amp;nbsp;char[] delimiter =&amp;nbsp; delimStr.ToCharArray();&lt;br /&gt;&amp;nbsp;string[] credentials = whatToGet.Split(delimiter);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;string[] infoResult = new string[credentials.Length];&lt;br /&gt;&amp;nbsp;int count = credentials.Length;&lt;br /&gt;&amp;nbsp;try&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;// Create a directory searcher on the path provided when created the instance&lt;br /&gt;&amp;nbsp;&amp;nbsp;DirectoryEntry entry&amp;nbsp;&amp;nbsp;= new DirectoryEntry(&amp;quot;&lt;a&gt;LDAP://OU=&lt;/a&gt; Users,DC=,DC=,DC=&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;DirectorySearcher searcher&amp;nbsp;= new DirectorySearcher(entry);&lt;br /&gt;&amp;nbsp;&amp;nbsp;string ToFind&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= &amp;quot;(&amp;quot; + whatToPass +&amp;quot;=&amp;quot; + account + &amp;quot;)&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;searcher.Filter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= ToFind;&lt;br /&gt;&amp;nbsp;&amp;nbsp;// Try to find the employee &lt;br /&gt;&amp;nbsp;&amp;nbsp;SearchResult result&amp;nbsp;&amp;nbsp;&amp;nbsp;= searcher.FindOne();&lt;br /&gt;&amp;nbsp;&amp;nbsp;if (result != null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Get the &amp;#39;DirectoryEntry&amp;#39; that corresponds to &amp;#39;result&amp;#39;.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;DirectoryEntry myDirectoryEntry = &amp;nbsp;result.GetDirectoryEntry();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Get the properties of the &amp;#39;mySearchResult&amp;#39;.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ResultPropertyCollection myResultPropColl;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;myResultPropColl&amp;nbsp;=&amp;nbsp;result.Properties;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(int i = 0; i &amp;lt; count; i++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//important !!! check if the property you want to get the information of exists in the user properties.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//if this check is missing an error will be thrown &amp;quot;Object reference not set to an instance of an object&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(myResultPropColl.Contains(credentials[i].ToString()))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//get all information entered for the current property&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach(Object myCollection in myResultPropColl[credentials[i].ToString()])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;infoResult[i] = myCollection.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;infoResult[i] = &amp;quot;-&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;return infoResult;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;catch (Exception ex)&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;infoResult[0] = ex.Message.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;return infoResult;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;/p&gt;</description></item></channel></rss>