久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Soapclient 查詢 Sharepoint Web 服務

Soapclient query a Sharepoint web service(Soapclient 查詢 Sharepoint Web 服務)
本文介紹了Soapclient 查詢 Sharepoint Web 服務的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我使用以下代碼成功查詢了一個服務 從這里

 "username", "password" => "password");$listName = "{2882F083-8890-4ADA-A1FC-39ED1D63D825}";$rowLimit = '150';$wsdl = "http://localhost:89/list.wsdl";$soapClient = new SoapClient($wsdl, $authParams);$params = array('listName' => $listName, 'rowLimit' => $rowLimit);$rawXMLresponse = null;嘗試{$rawXMLresponse = $soapClient->GetListItems($params)->GetListItemsResult->any;}趕上(SoapFault $fault){echo '故障代碼:'.$fault->faultcode;echo '故障字符串:'.$fault->faultstring;}echo '

'.$rawXMLresponse .'</pre>';$dom = 新的 DOMDocument();$dom->loadXML($rawXMLresponse);$results = $dom->getElementsByTagNameNS("#RowsetSchema", "*");foreach($results 作為 $result){echo $result->getAttribute("ows_LinkTitle")."<br/>";echo $result->getAttribute("ows_Body")."<br/>";}未設置($soapClient);?>

但是屬性 ows_Body 沒有顯示,可能是因為沒有在 $rawXMLresponse 中獲取該屬性.我如何在響應中得到它?如果 GetListItems 需要額外的查詢參數,我該如何格式化?

下面是從 rawXMLresponse 返回的內容

<pre><listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A2802F-100xml="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema"><rs:data ItemCount="3"><z:row ows_Attachments="0" ows_LinkTitle="低溫和水母" ows_Modified="2010-08-03 09:43:56" ows_Notice_x0020_Type="日歷" ows_MetaInfo="1;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Hypothermia and Jellyfish" "owshidows_IDversion="1="2" ows_UniqueId="1;#{B90ECA8C-6FBB-476D-BF67-A05B07268591}" ows_FSObjType="1;#0" ows_Created_x0020_Date="1;#2010-07:38591"092010-07-29 09:38:52" ows_FileLeafRef="1;#1_.000" ows_FileRef="1;#Lists/kk3/1_.000"/><z:row ows_Attachments="0" ows_LinkTitle=《獵蛇》 ows_Modified="2010-08-03 09:43:42" ows_Notice_x0020_Type="Public" ows_MetaInfo="2;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="The Hunting"Snark" ows_ID="2" ows_owshidenversion="2" ows_UniqueId="2;#{F070D967-97F1-40DF-803B-EF50424D205B}" ows_FSObjType="2;#0" ows_Created_x0020_Date="2;#2010-07"-29"2010-07-29 09:39:57" ows_FileLeafRef="2;#2_.000" ows_FileRef="2;#Lists/kk3/2_.000"/><z:row ows_Attachments="0" ows_LinkTitle="永遠不要低估自己" ows_Modified="2010-08-03 09:43:29" ows_Notice_x0020_Type="Public" ows_MetaInfo="3;#" ows__ModerationStatus="0" ows__Level="1" ows_TitleID="永遠不要低估_="3" ows_owshiddenversion="3" ows_UniqueId="3;#{4DBEC63E-E25F-4580-B5D8-590C584A6E95}" ows_FSObjType="3;#0" ows_Created_x0020_Date2:-09:-03;32" ows_Created="2010-07-29 09:40:32" ows_FileLeafRef="3;#3_.000" ows_FileRef="3;#Lists/kk3/3_.000"/></rs:data></listitems></pre>

解決方案

嘗試將 ViewFields 參數添加到您的查詢中.這允許您指定在查詢中返回哪些字段以及以什么順序返回.

viewFields 是 GetListItems 元素的子元素:

<視圖字段><FieldRef Name="LinkTitle"/><FieldRef Name="Body"/></ViewFields></viewFields>

根據您提供的示例,我猜測您要查找的列名稱;您可能需要根據 SharePoint 在內部實際調用這些列的內容進行調整.

ows_ 前綴被添加到列名中,因此除非從結果 XML 中檢索,否則您不會以該格式處理它們.

I successfully query a service with the following code from here

<?php
$authParams = array("login" => "username", "password" => "password");
$listName = "{2882F083-8890-4ADA-A1FC-39ED1D63D825}";
$rowLimit = '150';
$wsdl = "http://localhost:89/list.wsdl";
$soapClient = new SoapClient($wsdl, $authParams);
$params = array('listName' => $listName, 'rowLimit' => $rowLimit);
$rawXMLresponse = null;
try{
    $rawXMLresponse = $soapClient->GetListItems($params)->GetListItemsResult->any;
}
catch(SoapFault $fault){
    echo 'Fault code: '.$fault->faultcode;
    echo 'Fault string: '.$fault->faultstring;
}
echo '<pre>' . $rawXMLresponse . '</pre>';

$dom = new DOMDocument();
$dom->loadXML($rawXMLresponse);
$results = $dom->getElementsByTagNameNS("#RowsetSchema", "*");

foreach($results as $result){
    echo $result->getAttribute("ows_LinkTitle")."<br/>";
    echo $result->getAttribute("ows_Body")."<br/>";
}
unset($soapClient);
?>

However the attribute ows_Body doesnt display, probably because the atribute is not fetched in the $rawXMLresponse. How do I get that in the response? If the GetListItems requires an extra query paramater how do I format that?

below is what is returned from the rawXMLresponse

<pre><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"><rs:data ItemCount="3"><z:row ows_Attachments="0" ows_LinkTitle="Hypothermia and Jellyfish" ows_Modified="2010-08-03 09:43:56" ows_Notice_x0020_Type="Calendar" ows_MetaInfo="1;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Hypothermia and Jellyfish" ows_ID="1" ows_owshiddenversion="2" ows_UniqueId="1;#{B90ECA8C-6FBB-476D-BF67-A05B07268591}" ows_FSObjType="1;#0" ows_Created_x0020_Date="1;#2010-07-29 09:38:52" ows_Created="2010-07-29 09:38:52" ows_FileLeafRef="1;#1_.000" ows_FileRef="1;#Lists/kk3/1_.000"/><z:row ows_Attachments="0" ows_LinkTitle="The Hunting of the Snark" ows_Modified="2010-08-03 09:43:42" ows_Notice_x0020_Type="Public" ows_MetaInfo="2;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="The Hunting of the Snark" ows_ID="2" ows_owshiddenversion="2" ows_UniqueId="2;#{F070D967-97F1-40DF-803B-EF50424D205B}" ows_FSObjType="2;#0" ows_Created_x0020_Date="2;#2010-07-29 09:39:57" ows_Created="2010-07-29 09:39:57" ows_FileLeafRef="2;#2_.000" ows_FileRef="2;#Lists/kk3/2_.000"/><z:row ows_Attachments="0" ows_LinkTitle="Never undersell yourself" ows_Modified="2010-08-03 09:43:29" ows_Notice_x0020_Type="Public" ows_MetaInfo="3;#" ows__ModerationStatus="0" ows__Level="1" ows_Title="Never undersell yourself" ows_ID="3" ows_owshiddenversion="3" ows_UniqueId="3;#{4DBEC63E-E25F-4580-B5D8-590C584A6E95}" ows_FSObjType="3;#0" ows_Created_x0020_Date="3;#2010-07-29 09:40:32" ows_Created="2010-07-29 09:40:32" ows_FileLeafRef="3;#3_.000" ows_FileRef="3;#Lists/kk3/3_.000"/></rs:data></listitems></pre>

解決方案

Try adding a ViewFields parameter to your query. This allows you to specify which fields to return in the query and in what order.

viewFields is a child of the GetListItems element:

<viewFields>
   <ViewFields>
     <FieldRef Name="LinkTitle" />
     <FieldRef Name="Body" />
   </ViewFields>
</viewFields>

Based on the example you gave, I'm guessing at the column names you'd be after; you may need to adjust to whatever SharePoint is actually calling those columns internally.

The ows_ prefix is added to the column name, so you wouldn't address them in that format except when retrieving from the result XML.

這篇關于Soapclient 查詢 Sharepoint Web 服務的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Add programmatically a downloadable file to Woocommerce products(以編程方式將可下載文件添加到 Woocommerce 產品)
Get today#39;s total orders count for each product in Woocommerce(獲取今天 Woocommerce 中每種產品的總訂單數)
Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和電話字段驗證問題中添加自定義注冊字段)
Add a select field that will change price in Woocommerce simple products(在 Woocommerce 簡單產品中添加一個將更改價格的選擇字段)
Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中將自定義列添加到管理產品列表)
Customizing checkout quot;Place Orderquot; button output html(自定義結帳“下訂單按鈕輸出html)
主站蜘蛛池模板: 99久久婷婷国产综合精品电影 | 国产乱精品一区二区三区 | 国产精品久久久久久久免费观看 | 香蕉大人久久国产成人av | 99免费看 | 一区二区在线不卡 | 亚洲精品乱码久久久久久黑人 | 欧美 日本 国产 | 天堂色 | 91天堂网 | 性福视频在线观看 | 亚洲精品乱码久久久久久按摩观 | 国产一区三区在线 | 精品乱码一区二区三四区 | 在线成人精品视频 | 亚洲激情网站 | 欧美另类视频 | 色欧美片视频在线观看 | 日本精品视频在线观看 | 天天综合久久网 | 巨大黑人极品videos精品 | 久久久久久久综合色一本 | 韩国成人在线视频 | 天天干夜夜操 | 亚洲伊人精品酒店 | 操网站 | 国产日韩欧美 | 日本在线观看视频 | 亚洲国产精品一区二区三区 | 羞羞的视频在线观看 | 综合网视频 | 久久草视频 | 日本不卡一区 | 欧美日韩在线视频观看 | 一区二区三区免费 | 精品久久国产 | 精品在线一区二区 | 国产一级在线观看 | 米奇7777狠狠狠狠视频 | 亚洲高清网 | 成人午夜精品 |