I'm trying to call the Sharepoint web service "Lists.asmx". I'm getting the SoapOperation exception but it doesn't give the "message" other than that so I'm having trouble trying to find out where to start looking in my code.
Here's my C# code doing the call to the webservice:
I populate the ViewFields and QueryOptions variables as XMLElements that come from my XML file which looks like this:
And here's the Sharepoint service initialization:
I'm not all that sure on the xml portion so I'm thinking that's the safest bet, but I've tried many different combinations with no success.
Any help is appreciated!
Here's my C# code doing the call to the webservice:
Code:
try
{
xJobList = SharePointService.GetListItems("Batch Job Information", null, xQuery, xQueryFields, "1000", xQueryOptions, null);
}
catch (Exception ex)
{
MessageBox.Show("An error occurred retrieving the batch job information from Sharepoint.\r\n\r\n" + ex.ToString());
}
finally
{
SharePointService.Dispose();
}
I populate the ViewFields and QueryOptions variables as XMLElements that come from my XML file which looks like this:
Code:
<BatchJobInformationQuery>
<ViewFields>
<FieldRef Name='Batch Job Name' />
<!--<FieldRef Name='Tables Touched' />-->
</ViewFields>
<Query id='Default'>
<OrderBy>
<FieldRef Name='Batch Job Name' Ascending='TRUE' />
</OrderBy>
<Where>
<Neq>
<FieldRef Name='Batch Job Name' />
<Value Type='Text'></Value>
</Neq>
</Where>
</Query>
<QueryOptions>
<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>
<IncludeAttachmentUrls>FALSE</IncludeAttachmentUrls>
<DateInUtc>TRUE</DateInUtc>
</QueryOptions>
<BogusResult>
<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset"
xmlns:z="#RowsetSchema"
xmlns="[URL unfurl="true"]http://schemas.microsoft.com/sharepoint/soap/">[/URL]
<rs:data ItemCount="1">
<z:row ows_Batch_Job_Name="No Name" />
</rs:data>
</listitems>
</BogusResult>
</BatchJobInformationQuery>
And here's the Sharepoint service initialization:
Code:
private wsSharepoint_Lists.Lists SharePointService
{
get
{
if (_sharePointService == null)
{
_sharePointService = new BatchJobHistoryVisualizer.wsSharepoint_Lists.Lists();
_sharePointService.Url = "[URL unfurl="true"]http://portal/it/mvst/_vti_bin/lists.asmx";[/URL]
_sharePointService.PreAuthenticate = true;
_sharePointService.Credentials = System.Net.CredentialCache.DefaultCredentials;
}
return _sharePointService;
}
}
I'm not all that sure on the xml portion so I'm thinking that's the safest bet, but I've tried many different combinations with no success.
Any help is appreciated!