locked
Query parameter for GetListItems RRS feed

  • Question

  •      We created a report in VS using a data source which is connected to a sharepoint list. In the report we created a dataset with a SOAP call to the data source so we get the result from the sharepoint list

    we have used the following Query :

    <Query>
       <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
       <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
          <Parameters>
             <Parameter Name="listName">
                 <DefaultValue>{2b8a83a4-69e9-42d9-83ce-ded9ec664238}</DefaultValue>
               </Parameter>
           </Parameters>
       </Method>
      </Query>

    and we have added query parameter as specified in the
    http://stackoverflow.com/questions/1074529/soap-call-with-query-on-result-ssrs-sharepoint/1210625#1210625

    then also we are getting the the following error:
    Element &lt;Query&gt; of parameter query is missing or invalid.

    How can i resolve this?

    Thanks,
    Madhu.
    Wednesday, October 14, 2009 7:52 AM

Answers

  • Hi Madhu,

    If we use the xml value in the query parameter, we will get the error you have mentioned:
    Element &lt;Query&gt; of parameter query is missing or invalid.

    To solve the issue, please follow these steps:
    1.Change the query string to be:
    <Query>
       <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
       <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
          <Parameters>
             <Parameter Name="listName">
                 <DefaultValue>{2b8a83a4-69e9-42d9-83ce-ded9ec664238}</DefaultValue>
               </Parameter>
                <Parameter Name="query" Type="xml">         
                </Parameter>
           </Parameters>
       </Method>
      </Query>


    2.Click the ellipsis button(...) beside DataSet dropdownload list. That is used to open the property dialog of the current dataset.
    3.In the DateSet properties dialog, go to "Parameters" tab.
    4.In parameter tab, create a parameter with:
    Name: query
    Value: <Query><Where><Eq><FieldRef Name="ID"/><Value Type="Integer">1</Value></Eq></Where></Query>

    Please note, case sensitive is required.

    Please feel free to ask, if you have any more questions.

    Thanks,
    Jin Chen
    Jin Chen - MSFT
    • Marked as answer by madhulatha Thursday, October 15, 2009 12:23 PM
    Thursday, October 15, 2009 8:44 AM
  • Thanks Jin..

    Its Working...
    • Marked as answer by madhulatha Thursday, October 15, 2009 12:24 PM
    Thursday, October 15, 2009 12:23 PM

All replies

  • Hi Madhu,

    If we use the xml value in the query parameter, we will get the error you have mentioned:
    Element &lt;Query&gt; of parameter query is missing or invalid.

    To solve the issue, please follow these steps:
    1.Change the query string to be:
    <Query>
       <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
       <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
          <Parameters>
             <Parameter Name="listName">
                 <DefaultValue>{2b8a83a4-69e9-42d9-83ce-ded9ec664238}</DefaultValue>
               </Parameter>
                <Parameter Name="query" Type="xml">         
                </Parameter>
           </Parameters>
       </Method>
      </Query>


    2.Click the ellipsis button(...) beside DataSet dropdownload list. That is used to open the property dialog of the current dataset.
    3.In the DateSet properties dialog, go to "Parameters" tab.
    4.In parameter tab, create a parameter with:
    Name: query
    Value: <Query><Where><Eq><FieldRef Name="ID"/><Value Type="Integer">1</Value></Eq></Where></Query>

    Please note, case sensitive is required.

    Please feel free to ask, if you have any more questions.

    Thanks,
    Jin Chen
    Jin Chen - MSFT
    • Marked as answer by madhulatha Thursday, October 15, 2009 12:23 PM
    Thursday, October 15, 2009 8:44 AM
  • Thanks Jin..

    Its Working...
    • Marked as answer by madhulatha Thursday, October 15, 2009 12:24 PM
    Thursday, October 15, 2009 12:23 PM