Women in Technology

Hear us Roar



Article:
  Sliding into WebDAV
Subject:   WebDAV & NTLM:Hi i am facing a problem to connect to MSSharePoint 2003 portal server
Date:   2006-09-22 00:19:19
From:   sureshvarma
I tried the following code to connect to Microsoft SharePoint 2003 PortalServer.


NTCredentials creds = new NTCredentials(userName, password, hostAdd, domain );
HostConfiguration hostConfig = new HostConfiguration();
hostConfig.setHost(hostAdd);
HttpURL host = new HttpURL("http://" + hostUrl);
host.setUserinfo(username,password);
WebdavResource res = new WebdavResource(host, (Credentials)creds, WebdavResource.DEFAULT, DepthSupport.DEPTH_1);



And I am getting HttpException like below..
org.apache.commons.httpclient.HttpException
at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3467)
at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3423)


etc..


It is very urgent for me,please help me.


Thanks in advance


Regards
Suresh Varma

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • WebDAV & NTLM:Hi i am facing a problem to connect to MSSharePoint 2003 portal server
    2007-02-12 09:20:56  PabloMosquera [View]

    Hi, Im having the same problem with the same httpException. Im trying to connect to a IIS server and I use the same code. Please tell me how you solved the problem

    Thanks
    • WebDAV & NTLM:Hi i am facing a problem to connect to MSSharePoint 2003 portal server
      2008-07-25 05:47:52  httpclient.HttpException [View]



      Hi, Im having the same problem with the same httpException. Im trying to connect to a IIS server and I use the below code. Please tell me how you solved the problem


      public static boolean fileUpload(String localfilepath,String url,String destfolder,String destfile)
      {
      boolean success=false;
      try
      {

      File file = new File(localfilepath);
      BufferedImage image = ImageIO.read(file);
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      ImageIO.write(image, "bmp", bos);
      byte byteArr[] = bos.toByteArray();
      bos.close();

      HttpURL hrl =new HttpURL(url);
      //hrl.setUserinfo("uname","password");
      WebdavResource wdr =new WebdavResource(hrl);
      success = wdr.putMethod("/"+destfolder+"/"+destfile, byteArr);
      wdr.close();
      System.out.println(success);

      }catch(Exception ex)
      {
      ex.printStackTrace();
      }

      return success;

      }

      My IIS server is running in windows server 2003 platform.and i will get the exception below.



      org.apache.commons.httpclient.HttpException
      at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3467)
      at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3423)
      at org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResource.java:967)
      at org.apache.webdav.lib.WebdavResource.setBasicProperties(WebdavResource.java:912)
      at org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java:1894)
      at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1301)
      at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1320)
      at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1408)
      at org.apache.webdav.lib.WebdavResource.<init>(WebdavResource.java:290)

      ------------------------------------------------

      But the same above code work successfully by connecting the IIS server which is running in WindowsXP platform. Please Suggest the solution and help me. Thanks a lot.

      By Saravanan.K