Just starting to get my feet wet with Web Services calls to SharePoint(2010) and making calls like GetWebCollection and GetListCollection are working correctly and returning the expected data. Running the GetListCollection returns all the SP Lists as expected.

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetListCollection xmlns="http://schemas.microsoft.com/sharepoint/soap/" />
</soap:Body>
</soap:Envelope>

From the SP Lists returned, I extract the Internal Name for the Calendar list {A2CEBD3C-D07A-44A3-BE34-975AFE57F56C}

<_sList>
    <InternalName>{A2CEBD3C-D07A-44A3-BE34-975AFE57F56C}</InternalName>
    <Title>Calendar</Title>
    …..

My problem comes when I try to make a GetList call with that ID value as:

NSString *soapFormat = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
                        "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
                        "<soap:Body>\n"
                        "<GetList xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\" />\n"
                        "<listName>{A2CEBD3C-D07A-44A3-BE34-975AFE57F56C}</listName>\n"
                        "</GetList>\n"
                        "</soap:Body></soap:Envelope>\n"];


    NSLog(@"Request is : %@",soapFormat);

    NSURL *locationOfWebService = [NSURL URLWithString:@"http://192.168.0.114/_vti_bin/lists.asmx"];

    NSLog(@"Web url = %@",locationOfWebService);

    NSMutableURLRequest *theRequest = [[NSMutableURLRequest alloc]initWithURL:locationOfWebService];

    NSString *msgLength = [NSString stringWithFormat:@"%d",[soapFormat length]];


    [theRequest addValue:@"text/xml" forHTTPHeaderField:@"Content-Type"];
    [theRequest addValue:@"http://schemas.microsoft.com/sharepoint/soap/GetList"
                            forHTTPHeaderField:@"SOAPAction"];
    [theRequest addValue:msgLength forHTTPHeaderField:@"Content-Length"];
    [theRequest setHTTPMethod:@"POST"];

When I run this in the iPad 5.1 Simulator, the GetList call authenticates and connects, but returns 0 bytes back.

2013-01-05 13:31:56.053 SoapSharePoint[1936:c07] Request is : <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetList xmlns="http://schemas.microsoft.com/sharepoint/soap/" />
<listName>{A2CEBD3C-D07A-44A3-BE34-975AFE57F56C}</listName>
</GetList>
</soap:Body></soap:Envelope>
2013-01-05 13:31:56.055 SoapSharePoint[1936:c07] Web url = http://192.168.0.114/_vti_bin/lists.asmx
2013-01-05 13:31:56.059 SoapSharePoint[1936:c07] Connected...
2013-01-05 13:31:56.136 SoapSharePoint[1936:c07] Received Auth Req.
2013-01-05 13:31:56.147 SoapSharePoint[1936:c07] Received 0 Bytes!
2013-01-05 13:31:56.147 SoapSharePoint[1936:c07]

Using Fiddler and using U2U CAML Query Builder on another workstation I can see the U2U product issues a GetListCollection, GetAllSubWebCollections when it starts up (knows all sites and lists now) and when I double-click on the Calendar list they send this SOAP request:

POST http://g2010/_vti_bin/lists.asmx HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.5466)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/GetList"
Host: g2010
Content-Length: 378
Expect: 100-continue
Connection: Keep-Alive

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetList xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>{A2CEBD3C-D07A-44A3-BE34-975AFE57F56C}</listName>
</GetList>
</soap:Body>
</soap:Envelope>

This returns the List fields, and allows me to build a CAML query which then returns the 2 items in the Calendar list. I'm not seeing why MY call to GetList is not returning any data and was hoping someone could spot my obvious error :-)

Thanks!

share|improve this question
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.