3.1.4.6 AddCrawlRule

This operation is used to create a new crawl rule for the portal content project.

 <wsdl:operation name="AddCrawlRule">
         <wsdl:input message="AddCrawlRuleSoapIn"/>
         <wsdl:output message="AddCrawlRuleSoapOut"/>
 </wsdl:operation>

The protocol client sends an AddCrawlRuleSoapIn request message and the protocol server responds with an AddCrawlRuleSoapOut 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 path element of the request message the same way it normalizes the path element of the ActivateCrawlRule operation request message.

  • If a crawl rule with the same normalized path already exists in the portal content project, the protocol server MUST throw a SOAP fault message containing a COMException with the HRESULT field set to 0x80040d02.

  • If the protocol server has not thrown an exception, it MUST now create a new crawl rule with:

    • path property set to the normalized path.

    • type property set to the value of the isIncludeRule element from the request message

    • enabled property set to true.

  • The protocol server MUST add the created crawl rule to the end of the crawl rules collection in the portal content project.

  • If the crawl rule was successfully added, the protocol server MUST return the normalized path property of the newly created crawl rule in the AddCrawlRuleResult element of the response message.

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