வகை பதிவுகள்: ஷேர்பாயிண்ட் வலை சேவைகள்

ஒரு தேடல் நோக்கம் என மக்கள் எப்படி குறிப்பிடுவது / உள்ளடக்கம் மூல பயன்படுத்தி ஷேர்பாயிண்ட் 2013 REST API

I had reason to work with the SharePoint 2013 Search API via REST for the first time. I wanted to search for people, not documents. The key learning here is that you specify content sources via its GUID (or at least in this case). The following jQuery snippet shows how:

    loadExpertsAsync: செயல்பாடு() {

        jQuery.support.cors = உண்மையான;

        $.ajax({
            URL: இந்த.CreateFullApiUrl() +
                "?querytext='portals'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'" +
                "&selectproperties='LinkedInProfileUrl,GoogleCirclesProfileUrl,BALargeProfilePictureUrls,BAGridPictures,WorkEmail,Skills,AboutMe,Interests,JobTitle,PastProjects,PictureURL,PreferredName,TwitterHandle,LinkedInProfileUrl,PreferredName,GoogleCirclesProfileUrl'" +
                "&rowlimit=99",
            முறை: "GET",
            headers: { "Accept": "application/json; odata=verbose" },
            cache: தவறான,
            success: செயல்பாடு (result) {

என் வழக்கு, I’m running the API against SharePoint online. To get the GUID, I followed these steps:

  1. Access the SharePoint admin center
  2. Select “search” from the left hand navigation
  3. Select “Manage Result Sources”
  4. Select “Local People Results”
  5. Look at the URL.

My URL looked something like:

https://xyzzy-admin.sharepoint.com/_layouts/15/searchadmin/EditResultSource.aspx?level=tenant&sourceid=b09a7990%2D05ea%2D4af9%2D81ef%2Dedfab16c4e31&view=1

The sourceid parameter is what worked for me.

(I understand that the sourceid may actually be a sort of permanent thing with SP, ஆனால் நான் எப்போதும் எப்படியும் பார்க்க வேண்டும் 🙂 ).

</இறுதியில்>

undefinedஎன்னுடைய குழுசேர்.

மணிக்கு ட்விட்டரில் என்னை பின் http://www.twitter.com/pagalvin

Lists.asmx, GetListItems மற்றும் கோப்புறைகள்

நான் ஷேர்பாயிண்ட் பகுதியாக வழங்கப்படும் list.asmx வலை சேவை சுற்றி இன்று யாரோ சில ஆராய்ச்சி செய்து கொண்டிருந்தேன் 2010 (மற்றும் முந்தைய).  அவள் மூல கோப்புறையில் உள்ள பட்டியலில் பொருட்களை பெற முடிந்தது (துணை கோப்புறைகளை பெயர்கள் உட்பட), ஆனால் துணை கோப்புறைகளை உள்ள பொருட்களை பெற முடியவில்லை.  நான் சில internets அன்று சுற்றி பார்க்க மற்றும் அது ஒரு ஆச்சரியமான பொதுவான கேள்வி.  இன்னும், நான் எளிய கேள்விக்கு ஒரு நல்ல பதில் கிடைக்கும் முடியவில்லை, "நான் கோப்புறையை தெரிந்தால், எப்படி நான் கோப்புறையில் பொருட்கள் கிடைக்கும்?"  நேர்மையானவர், நான் ஒரு போது என் சொந்த இந்த ஒரு கண்டுபிடிக்க வேண்டும் என்று நினைத்தேன் பின்னர் நான் அந்த கடின முயற்சி செய்யவில்லை ஸ்மைல்.

இந்த அமைக்க, நான் "பிளாக்கிங் சூழல்கள்" மற்றும் "உப அடைவுகள் உடன் தனிபயன் பட்டியல்" என்று பெயரிடப்பட்ட ஒரு தனிபயன் பட்டியலில் பெயர் ஒரு தளம் உருவாக்கப்பட்டது.  நான் என்ற கோப்புறைகளை உருவாக்கப்பட்ட:

  • ஆண்டு 2005
  • ஆண்டு 2006
  • ஆண்டு 2007

நான் கோப்புறை "இயர் 2006" ஒரு சில உருப்படிகள் சேர்க்கப்பட்டன.  இது போல் தான்:

image

என் நண்பர் சி # குறியீட்டை எழுதி மாறாக ஜாவா பயன்படுத்தி இல்லை, எனவே SOAP உறை உண்மையில் அவள் தேவை என்ன.  அந்த பெற, நான் jQuery ஒரு பிட் எழுதி பின்னர் உண்மையான HTTP உரையாடல் பெற fiddler பயன்படுத்தப்படும்.

இங்கே பொருத்தமான jQuery தான் (நீங்கள் ஒட்டவும் / நகலெடுக்க விரும்பினால் நான் கீழே குறியீடு கீழே நகலெடுக்க):

image

அவர்கள் முதல் முக்கிய ஒரு இரண்டையும் உள்ளடக்கியதாக இருக்கிறது <queryOptions> மற்றும் <QueryOptions> முனை.  இரண்டாவது முக்கிய என்று <கோப்புறை> முனை இது வாடிக்கையாளர் அணுகக்கூடிய ஒரு URL ஐ தான்.

இந்த பெற வழிகள் இருக்கலாம், jQuery பயன்படுத்தும் போது ஆனால் இந்த எனக்கு நன்றாக வேலை.

இங்கே மேலே சோப் உறை உள்ளது:

<soapenv:உறை xmlns:soapenv =’HTTP://schemas.xmlsoap.org / சோப்பு / உறை /’>                
  <soapenv:உடல்>
    <GetListItems xmlns =’
HTTP://schemas.microsoft.com / ஷேர்பாயிண்ட் / சோப்பு /’>
      <listname>உப அடைவுகள் உடன் விருப்ப பட்டியல்</listname>
      <viewFields>  
        <ViewFields>
          <FieldRef பெயர் = 'தலைப்பு’ />
          <FieldRef பெயர் = 'EncodedAbsUrl’ />
        </ViewFields>
      </viewFields>
      <queryOptions>
        <QueryOptions>
          <கோப்புறை>
HTTP://demoserver1/Blogging சூழல்கள் / பட்டியல்கள் / உட்பிரிவு கோப்புறைகள் / ஆண்டு 2006 உடன் தனிபயன் பட்டியல்</கோப்புறை>
        </QueryOptions>
      </queryOptions>
   
</GetListItems>
  </soapenv:உடல்>
</soapenv:கடித உறை>

இந்த சுற்றி உதாரணங்கள் மற்றும் விவாதம் நிறைய என்னை நான் தேவை இருந்தது என்று வழிவகுத்தது <QueryOptions> மற்றும் ஒரு கோப்புறை பெயரை குறிப்பிடவும்.  எனக்கு, நான் இரண்டு மடக்கு அது உள்ளே வேண்டும் <queryOptions> அதே போல் ஒரு முழு தகுதியுள்ள URL குறிப்பிடவும் <கோப்புறை> தண்டில் காணப்படும் கணு.

இங்கே jQuery AJAX அமைப்பு தான்:

$(ஆவணம்).தயார்(செயல்பாடு() {
       soapEnv = இருந்தது
           "<soapenv:உறை xmlns:soapenv =’HTTP://schemas.xmlsoap.org / சோப்பு / உறை /’> \
               <soapenv:உடல்> \
                    <GetListItems xmlns =’HTTP://schemas.microsoft.com / ஷேர்பாயிண்ட் / சோப்பு /’> \
                       <listname>உப அடைவுகள் உடன் விருப்ப பட்டியல்</listname> \
                       <viewFields> \
                           <ViewFields> \
                              <FieldRef பெயர் = 'தலைப்பு’ /> \
                              <FieldRef பெயர் = 'EncodedAbsUrl’ /> \
                          </ViewFields> \
                       </viewFields> \
                       <queryOptions> \
                         <QueryOptions> \
                           <கோப்புறை>http://demoserver1/Blogging சூழல்கள் / பட்டியல்கள் / உட்பிரிவு கோப்புறைகள் / ஆண்டு 2006 உடன் தனிபயன் பட்டியல்</கோப்புறை> \
                         </QueryOptions> \
                       </queryOptions> \
                   </GetListItems> \
               </soapenv:உடல்> \
           </soapenv:கடித உறை>";

</இறுதியில்>

என்னுடைய குழுசேர்.

மணிக்கு ட்விட்டரில் என்னை பின் http://www.twitter.com/pagalvin

Lists.asmx, GetList மற்றும் "மதிப்பு பூஜ்ஜிய இருக்க முடியாது”

நான் இன்று கண்டுபிடிக்கப்பட்டது என்று GetList() method in lists.asmx web service has to be called very carefully or it’s prone to throw a mysterious “Value cannot be null” exception (மற்றும் அனுமானித்து என்று நீங்கள் இன்னும் மோசமாக பொதுவான பிழை செய்தி கடந்த பெற முடியும், “Exception of type ‘Microsoft.SharePoint.SoapServer.SoapServerException’ எறியப்பட்ட. ")  குறிப்பாக, I found that you can’t provide any kind of prefix on the GetList method.  The following jQuery snippet illustrates the point:

image

If you do that, the web service responds with “Value cannot be null” as per this FIDDLER-provided HTTP transcript:

<?xml version="1.0" encoding="utf-8"?>
  <soap:கடித உறை
     xmlns:soap="
HTTP://schemas.xmlsoap.org / சோப்பு / உறை /"    
     xmlns:xsi=”
HTTP://www.w3.org/2001/XMLSchema-instance"
     xmlns:xsd="
HTTP://www.w3.org/2001/XMLSchema">

  <soap:உடல்>
    <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <faultstring>
        Exception of type ‘Microsoft.SharePoint.SoapServer.SoapServerException’ was thrown.
      </faultstring>
      <detail>
        <errorstring xmlns="
HTTP://schemas.microsoft.com / ஷேர்பாயிண்ட் / சோப்பு /">
மதிப்பு பூஜ்ஜிய இருக்க முடியாது.
        </errorstring>
      </detail>
    </soap:Fault>
  </soap:உடல்>
</soap:கடித உறை>

நிச்சயமாக, you probably wouldn’t add that “s0” prefix on your own, but some tools are prone to do it (like Eclipse).

This is all the more confusing / frustrating because other methods tolerate prefixes.  உதாரணமாக, உருக்கு GetListCollection method doesn’t mind if it’s been prefixed, even with nonsense prefixes like “xyzzy”:

image

This “value cannot be null” seems fairly common with lists.asmx so hopefully this will help someone out in future.

</இறுதியில்>

என்னுடைய குழுசேர்.

மணிக்கு ட்விட்டரில் என்னை பின் http://www.twitter.com/pagalvin