Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try this:</p> <pre><code>&lt;!--- parse a bunch of XML documents, case-sensitively ---&gt; &lt;cfset ndQuery = XmlParse("&lt;Where&gt;&lt;BeginsWith&gt;&lt;FieldRef Name='Name' /&gt;&lt;Value Type='Text'&gt;D&lt;/Value&gt;&lt;/BeginsWith&gt;&lt;/Where&gt;", True)&gt; &lt;cfset ndViewFields = XmlParse("&lt;FieldRef Name='ID' /&gt;", True)&gt; &lt;cfset ndQueryOptions = XmlParse("&lt;QueryOptions /&gt;", True)&gt; &lt;cfset listsService.GetListItems( "{52D3A638-FA12-44E8-9C17-5FBCD2899199}", "", ndQuery.XmlRoot, ndViewFields.XmlRoot, "1", ndQueryOptions.XmlRoot, )&gt; &lt;cfset ServiceResponse = GetSOAPResponse(listsService)&gt; &lt;cfdump var="#ServiceResponse#"&gt; </code></pre> <p>Maybe it is unnecessary to explicitly pass in the XML root node, and the Web Service handles complete XML document objects just as well. In this case, the following call could also be fine:</p> <pre><code>&lt;cfset listsService.GetListItems( "{52D3A638-FA12-44E8-9C17-5FBCD2899199}", "", ndQuery, ndViewFields, "1", ndQueryOptions, "" )&gt; </code></pre> <hr> <p>EDIT: The MSDN page on <a href="http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems.aspx" rel="nofollow noreferrer">Lists.GetListItems Method</a> states:</p> <blockquote> <p><em><code>queryOptions</code></em>: To pass an empty value for this parameter, include an empty QueryOptions element as follows.</p> <pre><code>&lt;queryOptions xmlns:SOAPSDK9="http://schemas.microsoft.com/sharepoint/soap/"&gt; &lt;QueryOptions/&gt; &lt;/queryOptions&gt; </code></pre> </blockquote> <p>So, let's try this:</p> <pre><code>&lt;cfset ndQueryOptions = XmlParse("&lt;queryOptions xmlns:SOAPSDK9="http://schemas.microsoft.com/sharepoint/soap/"&gt;&lt;QueryOptions/&gt;&lt;/queryOptions&gt;", True)&gt; </code></pre> <hr> <p>EDIT #2</p> <p>There may also be a completely different problem - the last parameter of the <code>GetListItems()</code> method is optional and should be set to <code>null</code> if you don't want to pass a GUID string. </p> <p>Unfortunately the calling syntax you use is incapable of expressing omitted parameters, and CFML has no literal null. You must convert your call to the more verbose (but more flexible) <code>&lt;cfinvoke&gt;</code>/<code>&lt;cfinvokeargument&gt;</code> style for this:</p> <pre><code>&lt;cfobject webservice = "http://sharepointserver:16999/blog/_vti_bin/Lists.asmx?wsdl" name = "listsService" password = "pw" username = "user" &gt; &lt;cfinvoke webservice = "#listsService#" method = "GetListItems" returnvariable = "result" timeout = "10" &gt; &lt;cfinvokeargument name="listName" value="{52D3A638-FA12-44E8-9C17-5FBCD2899199}"&gt; &lt;cfinvokeargument name="viewName" value=""&gt; &lt;cfinvokeargument name="query" value="#ndQuery.XmlRoot#"&gt; &lt;cfinvokeargument name="viewFields" value="#ndViewFields.XmlRoot#"&gt; &lt;cfinvokeargument name="rowLimit" value="1"&gt; &lt;cfinvokeargument name="queryOptions" value="#ndQueryOptions.XmlRoot#"&gt; &lt;cfinvokeargument name="webID" value="" omit="yes"&gt; &lt;!--- setting "omit" to "yes" will turn the parameter to null ---&gt; &lt;/cfinvoke&gt; &lt;cfdump var="#result#" label="result"&gt; </code></pre> <p>More in-depth reading in this regard is on talkingtree.com:<br> <a href="http://www.talkingtree.com/blog/index.cfm/2006/7/12/cfinvokeargument-omit-attr" rel="nofollow noreferrer">How to invoke a Web Service while omitting optional service method arguments</a> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload