Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Sharepoint server URL [modified]

Sharepoint server URL [modified]

Scheduled Pinned Locked Moved C#
helpsharepointsysadmintestingbeta-testing
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ramamurthi
    wrote on last edited by
    #1

    Hi All, I am facing two problems while accessing the Sharepoint server URL using HttpWebRequest/HttpWebResponse. Sample Code: try { string Url = "http:////; Uri destUri = new Uri(Url); HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(destUri); CredentialCache cache = new CredentialCache(); cache.Add(req.RequestUri, "Negotiate", new NetworkCredential(strUserName, strPassword, strDomain)); cache.Add(req.RequestUri, "NTLM", new NetworkCredential(strUserName, strPassword, strDomain)); req.Credentials = cache; HttpWebResponse ores = (HttpWebResponse)req.GetResponse(); ores.Close(); if(ores.StatusDescription.ToLower() == "ok") { MessageBox.Show("Success"); } else { MessageBox.Show(ores.StatusDescription); } } catch (WebException we) { MessageBox.Show("Web Exception : " + we.Message); } catch (Exception ex) { MessageBox.Show("General Exception : " + ex.Message); } Issue #1: I have created the folder inside a folder under sharepoint document library(ex: DocumentLibrary\Folder1\Folder2) Using the above code I am testing the connection, it returns Success up to Folder1(ex: http:////DocumentLibrary/Folder1) I am trying the add the Folder2 in URL, It returns web exception UnAuthorized for the same credential.(eg: http:////DocumentLibrary/Folder1/Folder2) Issue #2: If there is any space in document library name, it returns web exception "Bad URL" (eg: http:////Shared Documents) Can any one know how to fix these problems? Thanks Ram -- modified at 16:03 Saturday 8th September, 2007

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups