मैं शेयरप्वाइंट वेब सेवाओं से बात करने की मेरी WCF सेवा की स्थापना, विशेष रूप से मैं Lists.asmx और Copy.asmx सेवाओं का उपयोग करने की कोशिश कर रहा हूँ कठिनाई का एक बहुत होने की है।शेयरप्वाइंट वेब सेवा करने के लिए WCF साथ NTLM प्रमाणीकरण की स्थापना
मैं इसे विकास के लिए SharePoint के लिए एक http लिंक का उपयोग कर काम कर रहा है, लेकिन अब हम एक HTTPS लिंक करने के लिए स्विच की जरूरत है। मुझे वेब संदर्भ सेटअप मिला है और इस लिंक के लिए अपडेट किया गया है, लेकिन जब यह किसी सेवा को कॉल करने का प्रयास करता है (उदा: GetListItems) यह निम्न त्रुटि से त्रुटियों को मिटा देता है: अनुरोध HTTP स्थिति 401 के साथ विफल रहा: अनधिकृत।
मैं तो प्रमाणीकरण की किस प्रकार हमारे शेयरप्वाइंट सर्वर का उपयोग करता है, जो पता चला है NTLM होने के लिए देखने के लिए कोशिश की। इसके बाद मैंने इसके लिए web.config फ़ाइल को कॉन्फ़िगर करने का प्रयास किया।
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="InventoryService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true" targetFramework="4.0">
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="NewBinding0">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" proxyCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="InventoryService.Service1Behavior"
name="InventoryService.InventoryService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="NewBinding0"
contract="InventoryService.IInventoryService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="InventoryService.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<applicationSettings>
<InventoryService.Properties.Settings>
<setting name="InventoryService_WSCopy_Copy" serializeAs="String">
<value>http://site/_vti_bin/Copy.asmx</value>
</setting>
<setting name="InventoryService_SharepointLists_Lists" serializeAs="String">
<value>https://site/_vti_bin/Lists.asmx</value>
</setting>
</InventoryService.Properties.Settings>
</applicationSettings>
</configuration>
किसी को भी एक सुराग है, तो अगर मैं सेटअप यह कॉन्फ़िग फ़ाइल को सही ढंग से NTLM के लिए, जो वास्तव में मददगार होगा: यहाँ पूरे web.config फ़ाइल है।
इस सेटअप सही ढंग से है, तो मुझे लगता है मैं के बारे में अगर मैं सेटअप क्रेडेंशियल सही अगले प्रश्न की ओर आगे बढ़ने देगा:
inventoryList = new SharepointLists.Lists();
inventoryList.Url = "https://fullsiteurl/_vti_bin/Lists.asmx";
inventoryList.Credentials = new System.Net.NetworkCredential("user", "pass", "domain");
कोई इस पर जा सकते हैं, तो वह भी बहुत मददगार होगा।
फिर मुझे पता है कि कॉन्फ़िग फ़ाइल बहुत लंबी है और मैं अत्यधिक इसकी सराहना अगर आप इसे माध्यम से जाने के लिए मुझे अगर मैं सेटअप NTLM प्रमाणीकरण सही ढंग से पता है।
यह सब ठीक बाहर की जाँच करता है, तो मैं पता नहीं जहां SharePoint के साथ काम करने के लिए HTTPS लिंक हो रही पर शुरू कर दिया है (SharePoint करने के लिए मौजूदा HTTP लिंक अभी भी, कुछ समय के लिए सुलभ है जब तक मैं के साथ काम कर सेवा प्राप्त कर सकते हैं एचटीटीपीएस लिंक)।
को दूर कर सकता है बस सुनिश्चित करने के लिए, आप एक WCF सेवा है जो एक शेयरप्वाइंट वेब सेवा सही कॉल है? पहला सवाल: आप सीधे अपनी डब्ल्यूसीएफ सेवा के अंदर शेयरपॉइंट एपीआई का उपयोग क्यों नहीं कर रहे हैं? दूसरा प्रश्न: क्या आप निर्दिष्ट उपयोगकर्ता प्रमाण-पत्रों के साथ HTTPS में शेयरपॉइंट साइट ब्राउज़ कर सकते हैं? –
हां, मैं एक डब्ल्यूसीएफ सेवा का उपयोग कर रहा हूं जो साइट सूचियों के लिए वेब संदर्भ का उपयोग करके शेयरपॉइंट वेब सेवा को कॉल करता है .asmx url। 1. मैं शेयरपॉइंट एपीआई का उपयोग नहीं कर सकता क्योंकि सेवा उसी मशीन पर नहीं जा रही है क्योंकि शेयरपॉइंट, शेयरपॉइंट एपीआई केवल प्रयोग योग्य है यदि आप शेयरपॉइंट सर्वर के समान मशीन पर हैं। 2. हां, मेरे उपयोगकर्ता प्रमाण-पत्र HTTPS लिंक के साथ ठीक काम करते हैं, मैं उन प्रमाण-पत्रों का उपयोग करके वेब संदर्भ भी जोड़ सकता हूं। – PvpMan22