3.1.4.1 BeginPublish

     <wsdl:operation name="BeginPublish">
       <wsdl:input message="tns:BeginPublishSoapIn" />
       <wsdl:output message="tns:BeginPublishSoapOut" />
     </wsdl:operation>

The BeginPublish operation is used to transition the server into the "Publish" state. The connection information and user credentials that are necessary to open a connection to an instance of the server are passed in by using this operation. The useTransactions argument determines whether subsequent operations are performed transactionally.

BeginPublish MUST initiate a connection to the specified instance of the server by using the provided arguments.

The specific error returned to the client can vary as follows.

In the case of missing (empty string) arguments for the serverName, databaseName, sqlUsername, or sqlPassword parameters, an error in the following form is returned:

 System.ArgumentException:  Null values not allowed for parameters for BeginPublish.

In the case of invalid database credentials (a non-existent server, database, or username, or an invalid password), an error is returned. The error returned is in the following form:

 Microsoft.SqlServer.Hosting.Service.SqlErrorException:  An error occurred while trying to begin publish.

Invoking BeginPublish when not in the "Not Publishing" state results in an error being returned to the client. The error returned is in the following form:

 Microsoft.SqlServer.Hosting.Service.PublishOccurringException:  There is a current valid publishing session occurring.  You must close it before you can begin a new one.