SharePoint: 401 Auth error while adding file to Sh

2019-09-14 01:59发布

问题:

I am trying to add a XML file to a library in SharePoint 2010 site from a silverlight application. I am following the steps as in https://sharepoint.stackexchange.com/questions/1837/how-can-i-upload-a-file-to-a-sharepoint-document-library-using-silverlight-and-cl and http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/f135aaa2-3345-483f-ade4-e4fd597d50d4 and How can I upload a file to a Sharepoint Document Library using Silverlight and client web-services?.

But I am getting an Auth error.

On some changes to a silverlight view (MVC), the data is updated in the database. I trigger a service (basicHTTP) on the silverlight web app to get the data from the database and write an XML file. Once the file is written, I try to upload the file to the SharePoint library using the SharePoint's Copy webservice.

Any clue?

Edit:

I tried putting the code for uploading the file in a different service in the silverlight server. But, I cannot use WSHttp binding as Silverlight doesnot support it. I am using basicHttp binding. How can I send the windows user credentials?

回答1:

I have this in my clientconfig:

   <bindings>
      <basicHttpBinding>
        <binding name="CustomBinding" maxBufferSize="2147483647"
            maxReceivedMessageSize="2147483647">
          <security mode="TransportCredentialOnly" />
        </binding>
      </basicHttpBinding>
    </bindings>

Does that get you any further?