Freigeben über


3.1.4.2 CreateFolder

The CreateFolder operation creates folders, Calendar folders, Contacts folders, Tasks folders, and search folders.

It is recommended that before any data is read from or written to a folder, an implementation ensures that the folder exists and opens it, or creates it if it does not exist. Before a folder can be created, the parent folder MUST already exist. Trying to create a folder that already exists results in an error.

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

 <wsdl:operation name="CreateFolder">
     <wsdl:input message="tns:CreateFolderSoapIn" />
     <wsdl:output message="tns:CreateFolderSoapOut" />
 </wsdl:operation>

The following is the WSDL binding specification of the CreateFolder operation.

 <wsdl:operation name="CreateFolder">
     <soap:operation soapAction="http://schemas.microsoft.com/exchange/services/2006/messages/CreateFolder" />
     <wsdl:input>
         <soap:header message="tns:CreateFolderSoapIn" part="Impersonation" use="literal"/>
         <soap:header message="tns:CreateFolderSoapIn" part="MailboxCulture" use="literal"/>
         <soap:header message="tns:CreateFolderSoapIn" part="RequestVersion" use="literal"/>
         <soap:header message="tns:CreateFolderSoapIn" part="TimeZoneContext" use="literal"/>
         <soap:body parts="request" use="literal" />
     </wsdl:input>
     <wsdl:output>
         <soap:body parts="CreateFolderResult" use="literal" />
         <soap:header message="tns:CreateFolderSoapOut" part="ServerVersion" use="literal"/>
     </wsdl:output>
 </wsdl:operation>

The protocol client sends a CreateFolderSoapIn request WSDL message, and the protocol server responds with a CreateFolderSoapOut response WSDL message.

A successful CreateFolder operation request returns a CreateFolderResponse element with the ResponseClass attribute of the CreateFolderResponseMessage element set to "Success" and the ResponseCode element of the CreateFolderResponse element set to "NoError".

An unsuccessful CreateFolder operation request returns a CreateFolderResponse element with the ResponseClass attribute of the CreateFolderResponseMessage element set to "Error". The ResponseCode element of the CreateFolderResponseMessage element is set to a value of the ResponseCodeType simple type, as specified in [MS-OXWSCDATA] section 2.2.5.24.