| Register
Thursday, November 20, 2008
SharePoint Forums
SearchForum Home
     
  SharePoint Development  SharePoint Customization  Getting Soap ex...
 Getting Soap exception while uploading file to sp site
 
Satish
3 posts
5th
Joined
6/30/2008

Getting Soap exception while uploading file to sp site
Posted: 08 Jul 08 12:59 AM
  HI, i have two servers in one system under same domain

In one server 192.1681.0.112   only sharepoint has been installed.

In another server 192.168.1.245 only vs2005 has been installed

In 245 server i have written the following code to upload a file to 112 server by adding the webservice of Lists as

http://server/_vti_bin/Lists.asmx .

The code which i written is as follows

try

{

Stream fStream = File.Open(@"F:\General\CRM.txt", FileMode.Open);

byte[] contents = new byte[fStream.Length];

fStream.Read(contents, 0, (int)fStream.Length);

fStream.Close();

Lists objLists = new Lists();

objLists.Credentials = new NetworkCredential("satish.gorijala", "password", "devhyd");

objLists.Url = "http://mymoss:8080/_vti_bin/Lists.asmx";

objLists.AddAttachment("satish", "101", "CRM.txt", contents);

}

But i am getting the following error? How can i overthrough this? what's the solution? any idea?

 

"Microsoft.SharePoint.SoapServer.SoapServerException'."

After taking its inner text of exception the exceptions is as follows

"Value does not fall within the expected range."

 

Actually i have no subsites under the sharepoint site..

  http://devhydmoss:8080/Lists/satish/AllItems.aspx

 

So, the List "satish" is under main site itself. I am able to add new list or library easily without any exceptions.

But when i need to upload a file the soap exception comes into picture. using Lists.GetListCollection() method i retrived a lists of the sharepoint site. i have seen this list "satish" in mainsite itself.

 

Any idea regarding this...

  SharePoint Development  SharePoint Customization  Getting Soap ex...
(c) 2006 SharePoint Forums   |  Privacy Statement  |  Terms Of Use