3.1.4.5 AddCrawlMapping

This operation creates a new crawl mapping for the portal content project.

 <wsdl:operation name="AddCrawlMapping">
         <wsdl:input message="AddCrawlMappingSoapIn"/>
         <wsdl:output message="AddCrawlMappingSoapOut"/>
 </wsdl:operation>

The protocol client sends an AddCrawlMappingSoapIn request message and the protocol server responds with an AddCrawlMappingSoapOut response message, as follows:

  • On receipt the protocol server validates the versionIn value from the request message. If it doesn’t match the current configuration version of the crawler application, the protocol server MUST throw a SOAP fault message containing an UpdatedConcurrencyException.

  • The protocol server then updates the current configuration version of the crawler application to the value of versionIn+1.

  • The protocol server MUST normalize the source and target strings as follows:

    • Trim the leading and trailing spaces.

    • Remove the final character if it is the back slash (‘\’) character, or the forward slash (‘/’) character.

    • If the source and target strings become the same, (case insensitive), after the previous step, the protocol server MUST throw a SOAP fault message containing a COMException, with the HRESULT field set to 0x80040d40.

    • If the URL scheme as described in [RFC2396], section 3.1 is not present, and string is not an UNC path, the protocol server MUST prepend the path with the "http" scheme.

    • If the URL scheme, as described in [RFC2396], section 3.1 is "file", convert the string to a UNC path, removing "file" prefix from the string, and replacing every forward slash (‘/’) character with the back slash (‘\’) character.

    • If the URL scheme, as described in [RFC2396], section 3.1 is "http" or "https", replace every back slash (‘\’) character with the forward slash (‘/’) character.

    • When normalization fails, if the failure is because of string exceeding maximum length, the protocol server MUST throw a SOAP fault message containing COMException with the HRESULT field set to 0x80040d14. Otherwise, the protocol server MUST throw a SOAP fault message containing COMException with the HRESULT field set to 0x80040d40.

    • If the crawl mapping for the same normalized source or target exists, the protocol server MUST throw a SOAP fault message containing a COMException, with the HRESULT field set to 0x80040d02.

  • The protocol server MUST then create a new crawl mapping and append it to the mappings collection in the portal content project with the source property set to the normalized source, and the target property set to the normalized target.

  • On success, the protocol server MUST return the updated configuration version of the crawler application in the AddCrawlMappingResult element in the response message.

On error, the protocol server MUST throw a SOAP fault message.