Adds a comment to the specified document


Visual Basic (declaration)
Public Function AddDocumentComment( _ 
ByVal AuthenticationTicket as String, _ ByVal DocumentPath as String, _ ByVal CommentText as String) as XmlNode

C# (declaration)
public XmlNode AddDocumentComment( 
string AuthenticationTicket, string DocumentPath, string CommentText)


    string infoRouter ticket
    string Document path that the comment will be added.
    string The text of the comment

Return Value

returns xml fragment.
<response success="true" error="">
if success attribute is "true", the comment has been added.
if success attribute is "false", the error attribute indicates the encountered error.


The caller must have read access to the document by default.
The required right depends on Domain Policy.

minus gif Example

Visual Basic Example
    Public Shared Sub AddComment()
        Const IRAuthenticationTicket As String = "sid-XXXXXXXXXXXX"
	Const ServiceURL As String="http://docsrv/inforouter/srv.asmx"
        Const TargetIRPath As String = "/Human Resources/Letters/1234-1234-AB-Reference.PDF"

        Dim IR_OBJ As InfoRouter.srv
        Dim xml_response As System.Xml.XmlNode

            IR_OBJ = New InfoRouter.srv
            IR_OBJ.Url = ServiceURL

            Dim CommentText As String = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + _
                                        "Sed sagittis nibh cursus sapien lacinia ac semper ligula placerat." + _
                                        "Aliquam erat volutpat. " + Environment.NewLine + _
                                        "Proin gravida sagittis nisi eu eleifend. In mattis hendrerit nisl vel pharetra." + _
                                        "Pellentesque consequat viverra aliquam. Ut id lorem in leo accumsan ornare. "

            xml_response = IR_OBJ.AddDocumentComment(AuthenticationTicket, TargetIRPath, CommentText)
            'check response xml if any error occured.
            If xml_response.Attributes("success").Value = "true" Then
                Console.WriteLine("Comment has been added")
                Console.WriteLine("server response:" + xml_response.Attributes("error").Value)
            End If
            xml_response = Nothing

        Catch ex As Exception
            Console.WriteLine("error:" & ex.Message)
            xml_response = Nothing
            IR_OBJ = Nothing
        End Try
    End Sub