16.01.2013 Views

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

996 Part IX: Maintaining a Server in Windows SharePoint Services<br />

F36XR03<br />

Figure 36-3 <strong>Resource</strong>s returned using the search Web service<br />

By default, all portal site sources are searched. To get a list of the sources that<br />

are available to be searched, you can use the GetPortalSearchInfo method of the<br />

search Web service.<br />

Again, there are many Web service methods that start with Begin <strong>and</strong> have<br />

associated methods that start with End. These methods can be used to complete that<br />

functionality asynchronously.<br />

UserProfileService Web Service<br />

You created a proxy to the SharePoint Portal Server 2003 User Profile Web service<br />

named UserProfileWebService in the “Visual Studio .NET Setup” section of this chapter.<br />

Basically, this Web service lets you retrieve user profiles <strong>and</strong> their schema using a<br />

variety of different user IDs: GUID, index, <strong>and</strong> user account name. GUID <strong>and</strong> index<br />

will be useful when SharePoint Portal Server provides those tokens to us as the ID<br />

for a user.<br />

Again, you will use the same set of controls for this sample application as you did<br />

for the both the AreaService Web Service <strong>and</strong> the search Web Service examples. For this<br />

example, allow the user to initially type an account name into the text box. When the<br />

user clicks the button, you will attempt to retrieve the account name specified in the<br />

text box from SharePoint Portal Server 2003. You will save all successful searches in<br />

the tree view <strong>and</strong> present all profile details in the list view. If the user’s profile is not<br />

found, you will present a message in the list view indicating that status. If the user clicks<br />

on a previously successful account in the tree view, you will re-retrieve the profile<br />

using the GUID that you saved when the profile was initially retrieved.<br />

As with the previous Web services, you need to provide credentials to the<br />

UserProfileService Web service. So, you will use the getUserCredentials function created<br />

earlier in this chapter to help with this functionality.<br />

Place the following code in the button1_Click function:<br />

private void button1_Click(object sender, System.EventArgs e)<br />

{<br />

//1. Establish a proxy to the UserProfileService Web Service<br />

UserProfileWebService.UserProfileService userProfileWS =<br />

new UserProfileWebService.UserProfileService();

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!