You are viewing limited content. For full access, please sign in.

Question

Question

Error sending HTTP request to server

SDK
asked on June 13

We have a script to delete the electronic file component of a document through the SDK.  However, when the workflow runs we get a "Error sending HTTP request to the server" error and are not sure why.  The workflow profile connection is the fully qualified server name and workflow and the repository are on the same box.

Here is the code of the script:

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports Laserfiche.RepositoryAccess

Namespace WorkflowActivity.Scripting.SDKScript2
    '''<summary>
    '''Provides one or more methods that can be run when the workflow scripting activity is performed.
    '''</summary>
    Public Class Script1
        Inherits RAScriptClass100
        Protected Overrides Sub Execute()
            dim di as DocumentInfo = Document.GetDocumentInfo(StartingEntryInfo.Id, RASession)
            di.DeleteEdoc()
            di.Dispose()
        End Sub
    End Class
End Namespace

I also have another script that OCR's the document and that works totally fine:

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports Laserfiche.RepositoryAccess
imports Laserfiche.DocumentServices

Namespace WorkflowActivity.Scripting.SDKScript3
    '''<summary>
    '''Provides one or more methods that can be run when the workflow scripting activity is performed.
    '''</summary>
    Public Class Script1
        Inherits RAScriptClass100
        '''<summary>
        '''This method is run when the activity is performed.
        '''</summary>
        Protected Overrides Sub Execute()
            Using ocr As OcrEngine = OcrEngine.LoadEngine()
                dim id as Int32 = Integer.Parse(GetTokenValue("Entry ID"))
                dim d as DocumentInfo = new DocumentInfo(id,RASession)
                ocr.Run(d)
            End Using
        End Sub
    End Class

I know they are different scripts but I am not sure why one cannot seem to connect to the server it is already on..

 

Thanks,

Chris

0 0

Answer

APPROVED ANSWER
replied two days ago

A support case was opened for this issue. After changing the code to use RAScriptClass102, the issue was resolved.

0 0

Replies

replied on June 13

It's not a connection issue. Did you try looking in the activity errors log to see if you can get a stack trace to point you/us in a better direction for troubleshooting?

1 0
replied on June 13

Where would that be?  Sorry I am pretty new to the SDK.  It's funny, I disabled and re-enabled the activity and now get a different error message:  "The script method could not be found"

When I manually run the script I get "Error sending HTTP request to server.  The handle is invalid".

 

0 0
replied on June 13

Oh, the SDK script in Workflow is basically just another activity, so anything that goes wrong when running a workflow gets logged in the activity errors log which can be found in the WF Admin Console under Monitoring\Logs. You may have to change the script's options to report as errors though (the default is to report anything bad as a warning):

Does this happen every time the workflow runs or just sometimes?

0 0
replied on June 13

Oh, just in the WF Admin.  Yes, those show the Script method could not be found. 

 

Timestamp: 2018-06-13 16:28:50.811
Local Time: 6/13/2018 11:28:50 AM
Category: Activity
Machine: servername
Severity: Error
Application Domain: Laserfiche.Workflow.Service.exe
Process Id: 2088
Process Name: C:\Program Files\Laserfiche\Laserfiche Workflow 10\Laserfiche.Workflow.Service.exe
Win32 Thread Id: 580 - Task Work Thread [CustomTasks]
Thread Name: Task Work Thread [CustomTasks]
Message: <Exception handlingInstanceId="32d8ec1c-ee6e-41f2-8304-a5fb7b9ba252">
  <Description>An exception of type 'Laserfiche.LaserficheException' occurred and was caught.</Description>
  <DateTime>2018-06-13 11:28:50Z</DateTime>
  <ExceptionType>Laserfiche.LaserficheException, Laserfiche.Base, Version=9.0.0.0, Culture=neutral, PublicKeyToken=607dd73ee2bd1c00</ExceptionType>
  <Message>The script method could not be found. [0267-WF1]</Message>
  <Source>Laserfiche.Workflow.Runtime</Source>
  <HelpLink>Error Code 267</HelpLink>
  <Property name="ErrorId">267</Property>
  <Property name="AssemblyCode">WF</Property>
  <Property name="TargetSite">Laserfiche.Workflow.Runtime.Systems.Tasks.ITaskResult Execute(Laserfiche.Workflow.Runtime.Scripting.ScriptTaskOptions, Laserfiche.Workflow.Runtime.Systems.Tasks.TaskExecutorContext)</Property>
  <Property name="HResult">-2146233079</Property>
  <StackTrace>   at Laserfiche.Workflow.Runtime.Scripting.ScriptTaskExecutor.Execute(ScriptTaskOptions options, TaskExecutorContext status)</StackTrace>
  <additionalInfo>
    <info name="MachineName" value="servername" />
    <info name="TimeStamp" value="6/13/2018 4:28:50 PM" />
    <info name="FullName" value="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <info name="AppDomainName" value="Laserfiche.Workflow.Service.exe" />
    <info name="ThreadIdentity" value="" />
    <info name="WindowsIdentity" value="domain\laserfiche" />
  </additionalInfo>
</Exception>

0 0
replied on June 13

That looks like a mismatched version of Designer and Server. Are you sure they're both the same?

0 0
replied on June 13

Seems to be.  In About of the Designer we have 10.2.0.216.

 

If I properties the Laserfiche.workflow.service file in C:\...Laserfiche Workflow 10 it has a version of 10.2.0.216

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.