SharePoint 웹 서비스와 통신하기 위해 WCF 서비스를 설정하는 데 어려움을 겪었습니다. 특히 Lists.asmx 및 Copy.asmx 서비스를 사용하려고합니다.WCF에서 Sharepoint 웹 서비스로 NTLM 인증 설정
개발을 위해 공유 지점에 http 링크를 사용하고 있지만 이제는 HTTPS 링크로 전환해야합니다. 웹 참조 설정이 있고이 링크를 업데이트했지만 다음 오류로 인해 서비스 (예 : GetListItems)를 호출하려고하면 오류가 발생합니다. 요청이 HTTP 상태 401 : Unauthorized로 실패했습니다.
그런 다음 우리 Sharepoint Server가 사용하는 NTLM 인증 유형을 확인하려고했습니다. 그런 다음 web.config 파일을 구성하려고했습니다. 사람이 단서가있는 경우이 설정 파일을 올바르게 NTLM을위한 I 설정, 즉 정말 도움이 될 것입니다 경우
<?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>
다음은 전체의 Web.config 파일입니다. 누군가가이 이상 갈 수 있다면
inventoryList = new SharepointLists.Lists();
inventoryList.Url = "https://fullsiteurl/_vti_bin/Lists.asmx";
inventoryList.Credentials = new System.Net.NetworkCredential("user", "pass", "domain");
, 즉 매우 도움이 될 것입니다 :이 올바르게 설정하면
후 나는 자격 증명을 올바르게 I 설치하는 경우에 대해 다음 질문으로 이동합니다 같아요.
다시 제가 설정 파일이 꽤 길다는 것을 알고 있습니다. NTLM 인증을 올바르게 설정했는지 여부를 알려 주시면 감사하겠습니다.
이 모든 것이 확인되면, 나는 셰어 포인트가 작동하는 HTTPS 링크를 어디서부터 시작해야할지 모르겠다. (서비스가 작동 할 때까지는 셰어 포인트에 대한 기존의 HTTP 링크가 당분간은 여전히 액세스 가능하다. HTTPS 링크).
을 제거 할 수 있습니다, 당신은 셰어 웹 서비스를 잘 작성으로 호출하는 WCF 서비스를? 첫 번째 질문 : WCF 서비스에서 Sharepoint API를 직접 사용하지 않는 이유는 무엇입니까? 두 번째 질문 : 지정한 사용자 자격 증명으로 HTTPS의 SharePoint 사이트를 탐색 할 수 있습니까? –
예, 사이트 lists.asmx URL에 대한 웹 참조를 사용하여 Sharepoint 웹 서비스를 호출하는 WCF 서비스를 사용하고 있습니다. 1. 서비스가 Sharepoint와 동일한 컴퓨터에 있지 않기 때문에 Sharepoint API를 사용할 수 없습니다. Sharepoint API는 Sharepoint Server와 동일한 컴퓨터에있는 경우에만 사용할 수 있습니다. 2. 네, 내 사용자 자격 증명은 HTTPS 링크로 잘 작동합니다. 웹 자격 증명을 사용하여 웹 참조를 추가 할 수도 있습니다. – PvpMan22