The SetLinks operation is used by a protocol client to generate or clear tokenized sharing links for a document. The calling user MUST be a document owner in order to call this method successfully.

The following is the WSDL port type specification of the SetLinks WSDL operation.

 <wsdl:operation name="SetLinks" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <wsdl:input wsaw:Action="http://schemas.microsoft.com/clouddocuments/DocumentSharing/SetLinks" message="tns:DocumentSharing_SetLinks_InputMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:output wsaw:Action="http://schemas.microsoft.com/clouddocuments/DocumentSharing/SetLinksResponse" message="tns:DocumentSharing_SetLinks_OutputMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>
   <wsdl:fault wsaw:Action="http://schemas.microsoft.com/clouddocuments/DocumentSharing/SetLinksSharingServerErrorFault" name="SharingServerErrorFault" message="tns:DocumentSharing_SetLinks_SharingServerErrorFault_FaultMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/>

The protocol client sends a DocumentSharing_SetLinks_InputMessage request message and the server responds with a DocumentSharing_SetLinks_OutputMessage, as follows:

  1. Validates every element in the input message and sends a SOAP fault message with an error code 1 (section 8) if any element is invalid.

  2. If the server does not support sharing, or the calling user has no permissions to call this method, the server MUST return a SOAP fault with an error code 0 (section 8).

  3. If the server does not support tokenized sharing link support, or the specified document provides no tokenized sharing links, the server MUST return a SOAP fault with an error code 17 (section 8).

  4. Generates or clears corresponding tokenized sharing links for the document depending on the requested actions and then returns a SetLinksResponse element in the DocumentSharing_SetLinks_OutputMessage response message.

  5. If the action is to generate links, the server SHOULD check if links already exist, and return existing links before generating new ones.