Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Thu, 17 Jan 2008 05:47:01 -0800,    group: microsoft.public.exchange.development        back       


Using EWS to set default calendar permission (using asp.net/vb)   
Hi all!

I'm developing av webpage for registering new users in an organization. I 
would like to make the calendar of all new users readable for every other 
user in the organization.

I've read the Ex2007 SP1 SDK but the exaples there aren't very clear as how 
to use the UpdateFolder.


--- code begin

        Dim esb As New ExchangeServiceBinding
        esb.RequestServerVersionValue = New RequestServerVersion
        esb.RequestServerVersionValue.Version = 
ExchangeVersionType.Exchange2007_SP1
        esb.Credentials = New NetworkCredential("migr", "umo3", "aass")
        esb.Url = "https://exchangerver.domain.com/ews/exchange.asmx"


        'Owner of the calendar
        Dim user As New UserIdType
        user.PrimarySmtpAddress = "newuser@domain.com"


        'Who are we granting persmission?
        Dim defaultUser As New UserIdType
        defaultUser.DisplayName = "Default"


        'Set Permission Type = Reviewer
        Dim permSet As New PermissionSetType()
        permSet.Permissions = New PermissionType() {New PermissionType}

        permSet.Permissions(0).PermissionLevel = PermissionLevelType.Reviewer
        permSet.Permissions(0).UserId = defaultUser


        'Target
        Dim cal As New DistinguishedFolderIdType()
        cal.Id = DistinguishedFolderIdNameType.calendar
        Dim targetFolder As New TargetFolderIdType
        targetFolder.Item = cal



        'Update
        Dim rsp As New UpdateFolderResponseType
        Dim uf As New UpdateFolderType()

        uf.FolderChanges = New FolderChangeType() {New FolderChangeType}
        uf.FolderChanges(0).Item = targetFolder.Item


        Try

            rsp = esb.UpdateFolder(uf)

        Catch ex As Exception
            Response.Write("Message:<br>")
            Response.Write(ex.Message)
            Response.Write("<br>Inner:<br>")
            Response.Write(ex.InnerException)
        End Try

--- code end

When I execute the code I get the following error:
The request failed schema validation: The element 'FolderChange' in 
namespace 'http://schemas.microsoft.com/exchange/services/2006/types' has 
incomplete content. List of possible elements expected: 'Updates' in 
namespace 'http://schemas.microsoft.com/exchange/services/2006/types'.


Hope there is someone out there that can tell me what's missing

Cheers!
date: Thu, 17 Jan 2008 05:47:01 -0800   author:   hjensen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us