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
Try
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")
Else
Console.WriteLine("server response:" + xml_response.Attributes("error").Value)
End If
xml_response = Nothing
Return
Catch ex As Exception
Console.WriteLine("error:" & ex.Message)
Finally
xml_response = Nothing
IR_OBJ = Nothing
End Try
End Sub
|