------ Web Service Code ---------
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports Microsoft.SharePoint
_
_
_
Public Class Service
Inherits System.Web.Services.WebService
_
Public Function MakeDirectory(ByVal Library As String, ByVal ObjectID As String) As String
'Check to see if a directory exists if not create it under the library passed
Dim MyServer As New SPSite(Library)
Dim MyWeb As SPWeb
Dim MyFolder As SPFolder
'Open the Sharepoint Web
MyWeb = MyServer.OpenWeb
MyWeb.AllowUnsafeUpdates = True
MyFolder = MyWeb.GetFolder("Documents")
Try
MyFolder = MyWeb.GetFolder(ObjectID)
Catch ex As Exception
MyWeb.Folders.Add(ObjectID)
End Try
'Return the URL
Return MyWeb.GetFolder("Documents/" & ObjectID).Url
End Function
End Class
|