2014-07-02 194 views
0

我正在通過Sharepoint Web服務訪問共享點列表。在訪問列表集合時,我收到了這個異常。請幫助我。SOAP服務器異常

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown. 

這裏是我的代碼:

try 
      { 
       SPListService.ListsSoapClient client = new SPListService.ListsSoapClient(); 

       XElement element = client.GetListCollection(); 
      } 

      catch (Exception ex) { } 

這是我的web配置

<bindings> 
     <basicHttpBinding> 

     <binding name="ListsSoap"> 

      <security mode="TransportCredentialOnly"> 

      <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm="" /> 

      </security> 
     </binding> 
     </basicHttpBinding> 

    </bindings> 
    <client> 
     <endpoint address="http://abc:port/_vti_bin/Lists.asmx" binding="basicHttpBinding" 
     bindingConfiguration="ListsSoap" contract="SPListService.ListsSoap" 
     name="ListsSoap" /> 

    </client> 
+0

將null作爲參數傳遞給ListsSoapclinet()並嘗試 – Nadendla

+0

它引發異常。值不能爲空。 參數名稱:endpointConfigurationName – user1584253

回答

0

煤礦工作,但在綁定我的安全設置略有不同:

<binding name="ListsSoap"> 
    <security mode="TransportCredentialOnly"> 
    <transport clientCredentialType="Ntlm" proxyCredentialType="None" realm="" /> 
    <message clientCredentialType="UserName" algorithmSuite="Default" /> 
    </security> 
</binding> 

這應該與你的原始最終的代碼,因爲這是我在代碼中建立連接的全部內容。