<?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: SharePoint userprofileservice ModifyUserPropertyByAccountName</title><link>https://www.infopathdev.com:443/forums/thread/38396.aspx</link><pubDate>Fri, 13 Feb 2009 09:37:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38396</guid><dc:creator>Classgenerator</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38396.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=38396</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;i couldn&amp;#39;t wait no more, so i developed my own Web-Service which updates against the Object-Model of the UserProfileStore.&lt;/p&gt;
&lt;p&gt;This works great. Feel free to use this...&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Create a WebService-Project&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Add a Reference to Microsoft.Office.Server and to &lt;font size="2"&gt;Microsoft.SharePoint and&amp;nbsp;&lt;/font&gt;&lt;font size="2"&gt;Microsoft.SharePoint.Security;&lt;/font&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Add the using you need: &lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Microsoft.Office.Server;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Microsoft.Office.Server.UserProfiles;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Microsoft.SharePoint;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Microsoft.SharePoint.Security;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Microsoft.SharePoint.Administration;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; System.Security.Permissions;&lt;/font&gt;&lt;/div&gt;&lt;/li&gt;&lt;/font&gt;
&lt;div&gt;&lt;/div&gt;
&lt;li&gt;
&lt;div&gt;Give your MOSS-Contributer the permissions to manage user profiles (&lt;a href="http://moss:40000/ssp/admin/_layouts/ManageServicePermissions.aspx"&gt;http://moss:40000/ssp/admin/_layouts/ManageServicePermissions.aspx&lt;/a&gt;)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Add this attribute to the class: &lt;font size="2"&gt;[&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SharePointPermission&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SecurityAction&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.LinkDemand, ObjectModel = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)]&lt;/font&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Declare &lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;UserProfileManager&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; UPM = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;May you want to log... : Declare &lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;internal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; LogPath = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SPDiagnosticsService&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Local.LogLocation + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/UPS.utilities.log&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;internal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;StreamWriter&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; logger = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Add a logging method, e.g.: &lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Write(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; message) { &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SPSecurity&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.RunWithElevatedPrivileges(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;delegate&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;() { logger = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;StreamWriter&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(LogPath, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;); logger.WriteLine(System.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;DateTime&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Now.ToString() + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot; - &amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + message); logger.Flush(); logger.Close(); logger.Dispose(); }); }&lt;/font&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;In your webmethod create a instance of &lt;font color="#2b91af"&gt;UserProfileManager&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;: &lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SPSite&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; site = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SPSite&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(&lt;a href="http://intranet/"&gt;http://intranet&lt;/a&gt;)) {&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ServerContext&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; context = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ServerContext&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.GetContext(site);UPM = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;UserProfileManager&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(context);}&lt;/font&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;p&gt;Determine the UserProfile of a user: &lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;UserProfile&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; profile = UPM.GetUserProfile(UserName); UserName should be a parameter of the webmethod (domain\user).&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;font size="2"&gt;
&lt;p&gt;To update a property set the value: profile[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Porpertyname&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;].Value = newValue.ToString();&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;p&gt;&lt;font size="2"&gt;Commit the change: profile.Commit();&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;p&gt;Sign the assembly and install it to the GAC.&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;p&gt;Publish the WebService e.g. as a virtual directory under your Moss-Site&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;p&gt;&lt;font size="2"&gt;In the InfoPath-Form add Fields you need to set as the WebService-Parameter. Set the values e.g. in the Formoptions (Open/Rules) or somewhere else where it meets your requirements.&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;Create a DataConnection (send data; WebService) and choose your WebService.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;Choose the Fields to set as the parameter.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;Call the WebService from e.g. a rule of a command-button&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;
&lt;p&gt;This works fine in my Kerberos-Environment&lt;/p&gt;
&lt;p&gt;Good luck&lt;/p&gt;
&lt;p&gt;Ronny&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>SharePoint userprofileservice ModifyUserPropertyByAccountName</title><link>https://www.infopathdev.com:443/forums/thread/38272.aspx</link><pubDate>Tue, 10 Feb 2009 12:12:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38272</guid><dc:creator>Classgenerator</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38272.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=38272</wfw:commentRss><description>&lt;p&gt;Hi Experts,&lt;/p&gt;
&lt;p&gt;can not find a Documentation (just specification) on how to pass the &lt;strong&gt;ArrayOfPropertyData&lt;/strong&gt;-parameter for the&lt;/p&gt;
&lt;p&gt;WebMethod &lt;strong&gt;ModifyUserPropertyByAccountName&lt;/strong&gt; of SharePoint-WebService _vti_bin/&lt;strong&gt;userprofileservice&lt;/strong&gt;.asmx&amp;nbsp;&lt;/p&gt;
&lt;p&gt;when adding a Data Connection to my browser-enabled Form. I want to update a specific property in the UserProfileStore.&lt;/p&gt;
&lt;p&gt;In&amp;nbsp;the Data Connection Wizard&amp;nbsp;the parameter is:&lt;/p&gt;
&lt;table class=""&gt;

&lt;tr&gt;
&lt;td class=""&gt;&lt;strong&gt;Parameter&lt;/strong&gt;&lt;/td&gt;
&lt;td class=""&gt;&lt;strong&gt;Typ&lt;/strong&gt;&lt;/td&gt;
&lt;td class=""&gt;&lt;strong&gt;Element&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;s0:newData&lt;/td&gt;
&lt;td class=""&gt;ArrayOfPropertyData (complex type)&lt;/td&gt;
&lt;td class=""&gt;/my:Group/my:Field&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;In the parameter option section i can choose a field or group. BUT: how do i tell infopath which property to update with the selected value ???&lt;/p&gt;
&lt;p&gt;Do i have to insert the complete xml of the complex type regarding the property and the value i want to update?&lt;/p&gt;
&lt;p&gt;like this?&lt;/p&gt;
&lt;p&gt;&amp;lt;PropertyData&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;IsPrivacyChanged&amp;gt;&lt;font class="value" color="#00008b"&gt;&lt;strong&gt;false&lt;/strong&gt;&lt;/font&gt;&amp;lt;/IsPrivacyChanged&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;IsValueChanged&amp;gt;&lt;font class="value" color="#00008b"&gt;&lt;strong&gt;true&lt;/strong&gt;&lt;/font&gt;&amp;lt;/IsValueChanged&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name&amp;gt;&lt;strong&gt;UserProfilePropertyName&lt;/strong&gt;&amp;lt;/Name&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Privacy&amp;gt;&amp;lt;/Privacy&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Values&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ValueData xsi:nil=&amp;quot;true&amp;quot; &amp;gt;&lt;strong&gt;&amp;lt;/my:Group/my:Field&amp;gt;&lt;/strong&gt;&amp;lt;/ValueData&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ValueData xsi:nil=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Values&amp;gt;&lt;br /&gt;&amp;lt;/PropertyData&amp;gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Should be different? Right?&lt;/p&gt;
&lt;p&gt;Any help out there....&lt;/p&gt;
&lt;p&gt;Thanks Ronny&lt;/p&gt;</description></item></channel></rss>