RecordsRepository.SubmitFile Method (Official File)
Submits a file as a given record routing type, along with its metadata and, optionally, its audit history.

Web Service: Official FileWeb Reference: http://<Site>/_vti_bin/OfficialFile.asmx
Syntax

Visual Basic (Declaration)
<SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/recordsrepository/SubmitFile", RequestNamespace:="http://schemas.microsoft.com/sharepoint/soap/recordsrepository/", ResponseNamespace:="http://schemas.microsoft.com/sharepoint/soap/recordsrepository/", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
Public Function SubmitFile ( _
    fileToSubmit As Byte(), _
    properties As RecordsRepositoryProperty(), _
    recordRouting As String, _
    sourceUrl As String, _
    userName As String _
) As String
Visual Basic (Usage)
Dim instance As RecordsRepository
Dim fileToSubmit As Byte()
Dim properties As RecordsRepositoryProperty()
Dim recordRouting As String
Dim sourceUrl As String
Dim userName As String
Dim returnValue As String

returnValue = instance.SubmitFile(fileToSubmit, properties, recordRouting, sourceUrl, userName)
C#
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/recordsrepository/SubmitFile", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/recordsrepository/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/recordsrepository/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public string SubmitFile (
    byte[] fileToSubmit,
    RecordsRepositoryProperty[] properties,
    string recordRouting,
    string sourceUrl,
    string userName
)

Parameters

fileToSubmit

The file being submitted.

properties

A string representing a collection of RecordsRepositoryProperty objects, each of which represents a document property being submitted with the file.

recordRouting

A string representing the record routing type of the file.

sourceUrl

A string representing the current URL of the file being submitted.

userName

A string representing the logon name of the user who is submitting the file.

Return Value

The SubmitFile method returns a string that represents the result of the method call, in the following format.
<ResultCode>Success</ResultCode>
Result code values include:
  • Success

  • MoreInformation

  • InvalidConfiguration

  • InvalidArgument

  • InvalidUser

  • NotFound

  • FileRejected

  • UnknownError

If the file is missing required properties, the SubmitFile method can return a request for more information, using the MoreInformation result code.
Xml
<ResultCode>MoreInformation</ResultCode>
<ResultUrl>
http://servername/officialsitename/MissingProperties/Forms/EditForm.aspx?ID=GUID
</ResultUrl>
Where the ResultUrl element represents the path to the edit form for the item, where the user can enter the missing properties for the item. If the file is successfully uploaded, the SubmitFile method returns a Success result code.
Remarks

You can include a property that represents the audit history of the file being submitted. To do this, include a RecordsRepositoryProperty object with a Name property of "Audit History", and a Type property of XML. Store the actual audit history as XML in the Other property.

See Also

Tags :


Community Content

tlingenf
NotFound result from the OfficialFile.asmx WebService

If you want to push items to Records Center from an external application using the officialfile.asmx web service provided with MOSS you must add the users to the Records Center Web Service Submitters group. If you recieve a result string of: <ResultCode>NotFound</ResultCode> this is most likely your problem.

There is site group that authorizes the users who are allowed to submit using the web service. It is the Records Center Web Service Submitters group. Add your user or the Authenticated Users Active Directory Security Group to this group to grant permission to that user. By default this site group does not have any members, therefore effectively preventing ANYONE from using the SubmitFile method of the web service.

Tags :

Page view tracker