locked
SOAP Excpetion in GetListItems() RRS feed

  • Question

  • Hi frnds,

    I am using a webmethod GetListItems in one the Sharepoint Webservice of version 2007. Now recently they have upgraded it to sharepoint 2010 server.
    So there was change in the method GetListItems() in this version where they have added new field called WebId of type String.

    So I have modified my method accordingly by keeping string.empty. And I am getting the following generic error

    Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.

    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

    System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

    I tried passing null parameter and string.empty but nothing worked.

    ksLists.GetListItems(_projectsListGuid, null, query, null, "0", null,string.Empty);

    Please help me.

    Thanks,
    Sarath
    Monday, September 3, 2012 1:25 PM

Answers

  • Hi sarathrap,

    Does the list exists in the root of the site collection or in a sub site?

    If the list is in the root than you can call it with: http://yourserver:port/_vti_bin/Lists.asmx

    If the list you request is on a subsite you need to call the web service like this http://yourserver:port/SUBSITE/_vti_bin/Lists.asmx

    And also, you need check the  listname(guid) is currect in your SharePoint 2010.

    If it still got the error, pleae remove <Query> tag from your CAML query, and try it again.

    Thanks,
    Lhan Han

    • Marked as answer by Lhan Han Tuesday, September 18, 2012 3:29 AM
    Sunday, September 16, 2012 1:55 AM

All replies

  • hi

    as you have this parameter in your proxy's method, I assume that you already updated web service proxy in your project for Sharepoint 2010 version. Is it so? Try to get guid of the web site where your list is located (there are many methods to do it, e.g. you may open SPWeb object in powershell and print $web.Id property) and pass it in WebId parameter to web method.


    Blog - http://sadomovalex.blogspot.com
    CAML via C# - http://camlex.codeplex.com


    Monday, September 3, 2012 4:27 PM
  • Hi Sadom,

    Can we get this GUID in C# without any sharepoint objects. Because our's just normal asp site and we are just consuming this sharepoint Webservice. And yeah I have already new service proxy into my local.

    Thanks,

    Sarath.

    Wednesday, September 5, 2012 7:41 PM
  • You can call the webservice by passing a null in the webId parameter. This should not cause an exception, but only if the list is not in the rootweb.

    Could you check out the SoapException's InnerException and the SoapException.Detail property and then post that here?


    SharePoint Developer | @zeemanj | Blog

    Wednesday, September 5, 2012 8:01 PM
  • Hi Jeffrey,

    InnerException is null and here is the SoapExcpetion.Detail log

    <errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">
        List does not exist.
        The page you selected contains a list that does not exist.  It may have been deleted by another user.
        </errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x82000006</errorcode>

    After seeing I thought there is no data in my site. But I am able too see the data in the portal site. But same I am not getting from the service.

    Or could it be any problem in my CAML query. It's working for my old server which is still 2007.

    String.Format("<Query><Where><Eq><FieldRef Name=\"PEATSNumber\" /><Value Type=\"Lookup\">{0}</Value></Eq></Where></Query>", Value)

    Many Thanks.


    Thanks, Sarath

    Thursday, September 6, 2012 11:29 PM
  • Hi sarathrap,

    Does the list exists in the root of the site collection or in a sub site?

    If the list is in the root than you can call it with: http://yourserver:port/_vti_bin/Lists.asmx

    If the list you request is on a subsite you need to call the web service like this http://yourserver:port/SUBSITE/_vti_bin/Lists.asmx

    And also, you need check the  listname(guid) is currect in your SharePoint 2010.

    If it still got the error, pleae remove <Query> tag from your CAML query, and try it again.

    Thanks,
    Lhan Han

    • Marked as answer by Lhan Han Tuesday, September 18, 2012 3:29 AM
    Sunday, September 16, 2012 1:55 AM
  • Hi Han,

    I found the issue. As you said it's due to new GUID for that list. Now I am able get some response without error.

    Thanks,


    Thanks, Sarath

    Tuesday, September 25, 2012 8:23 PM