@@ -22,7 +22,8 @@ ClassMethod getCurrentProduction() As Ens.Config.Production
22
22
/// If <var>serviceName</var> is not specified then EnsLib.Testing.Service is used.
23
23
/// In that case "Testing Enabled" production setting should be checked.
24
24
/// Specify <var>sessionId</var> if the request should be sent in the scope of a particular session.
25
- ClassMethod sendRequestFromService (targetHostName As %String , message As %Persistent , serviceName As %String = " EnsLib.Testing.Service" , sessionId As %Integer = " " , description As %String = " " ) As %Status
25
+ /// The actual session ID is recorded to <var>sessionId</var> once the message has been sent.
26
+ ClassMethod sendRequestFromService (targetHostName As %String , message As %Persistent , serviceName As %String = " EnsLib.Testing.Service" , ByRef sessionId As %Integer = " " , description As %String = " " ) As %Status
26
27
{
27
28
#dim prod As Ens.Config.Production = ..getCurrentProduction ()
28
29
if '$isObject (prod ) quit $$$ERROR($$$GeneralError, " No running production" )
@@ -34,9 +35,11 @@ ClassMethod sendRequestFromService(targetHostName As %String, message As %Persis
34
35
#dim sc As %Status = ##class (Ens.Director ).CreateBusinessService (serviceName , .service )
35
36
if $$$ISERR(sc ) quit sc
36
37
37
- if (sessionId '= " " ) set service .%SessionId = sessionId
38
+ if ($get (sessionId ) '= " " ) set service .%SessionId = sessionId
39
+ set sc = service .SendRequestAsync (targetHostName , message , description )
40
+ set sessionId = service .%SessionId
38
41
39
- quit service . SendRequestAsync ( targetHostName , message , description )
42
+ quit sc
40
43
}
41
44
42
45
/// Find a business host by name and type.
0 commit comments