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

Question

Question

Error sending HTTP request to server

SDK
asked on June 13, 2018

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

1 0

Answer

APPROVED ANSWER
replied on June 15, 2018

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

1 0

Replies

replied on June 13, 2018

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, 2018

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, 2018

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, 2018

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, 2018

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

1 0
replied on June 13, 2018

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
replied on June 20, 2018

I am getting the same error when my sdk script runs. Old workflows that use the script work fine, but since we upgraded to 10.3 new workflows are not working correctly. My laserfiche server is 10.3.1.181 and my designer is 10.2.0.216. Could this be the problem?

0 0
replied on June 20, 2018

Which error exactly?

0 0
replied on June 20, 2018

"Error sending HTTP request to server"

0 0
replied on June 21, 2018

My SDKscript issue was resolved by changing to "RAScriptClass102" as mentioned early in this post.

Thank you!!

0 0
replied on April 22, 2022

Cn you please share the steps taken to use RASScriptClass102? I am getting this error, but am not using SDK script. Rather a regular script activity. Thanks!

0 0
replied on April 22, 2022

The version of RA should match the version of your server. Script activities are not recommended for use when you are trying to access Laserfiche because you would have to make and manage your own connections (and will be limited as to the number of concurrent connections to the repository). Use an SDK script activity instead so Workflow manages your connection.

An SDK script activity will automatically add " Inherits RAScriptClass100 " where the last number will correspond to the RA version used by the Workflow Server.

1 0
replied on April 22, 2022

great tip, thank you!

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

Sign in to reply to this post.