%ProcessError+6 ^%Net.Remote.Proxy.1 error occurs inconsistently
Hi
I'm trying to learn me working with .NET libraries and Ensemble.
I have made a very simple .Net dll which just simple write a text to a file.
I have import the libraries in the studio , putted up a EnsLib.DotNetGateway.Service in my namespace. Everything by the book. The EnsLib.DotNetGateway.Service starts fine and i trigger the simple call by a fileinbound.adapter (tried in normal class as well. But i'm stuck in a error message i can't figure out what is wrong.
This is the error message:
"ERROR <Ens>ErrException: <ZJGTW>%ProcessError+6 ^%Net.Remote.Proxy.1 -- logged as '-'
number - @''"
The code to call is simple:
Set conn = ##class(%Net.Remote.Gateway).%
Set tSC = conn.%Connect("127.0.0.1", "55000", "NETTEST") // No error here
Set api = ##class(writetofile.WriteFile)
set strFile = "d:\temp\example.txt"
set strInput = "Hello world"
set ret = api.FilePut(strFile,strInput)
Set tSC = conn.%Disconnect()
If i just connect and disconnet to the Net.Remote.Gateway no error
Here is the proxy classe
Class writetofile.WriteFile Extends System.Object [ ProcedureBlock ]
{
Parameter IMPORTTIMESTAMP As STRING = "2013-07-17 16:40:43";
Method %OnNew(ByRef p0 As %ObjectHandle ) As %Status
{
If '$D(p0) If ($IO["TCP") { Quit $$$OK } Else { Set x=$$$ERROR ($$$RemoteGatewayError,"Gateway instance must be supplied" ) Zt "JGTW" }
Quit ..%Constructor(p0,"writetofile.WriteFile" ,0)
}
Method getuFileText() As %ObjectHandle
{
Quit ..%IR("get_FileText")
}
Method setuFileText(ByRef p0 As %ObjectHandle)
{
Do ..%I("set_FileText",.p0)
}
Method getuFilePath() As %ObjectHandle
{
Quit ..%IR("get_FilePath")
}
Method setuFilePath(ByRef p0 As %ObjectHandle)
{
Do ..%I("set_FilePath",.p0)
}
Method FilePut(ByRef p0 As %ObjectHandle , ByRef p1 As %ObjectHandle)
{
Do ..%I("FilePut",.p0,.p1)
}
}
{
Parameter IMPORTTIMESTAMP As STRING = "2013-07-17 16:40:43";
Method %OnNew(ByRef p0 As %
{
If '$D(p0) If ($IO["TCP") { Quit $$$OK } Else { Set x=$$
Quit ..%Constructor(p0,"
}
Method getuFileText() As %ObjectHandle
{
Quit ..%IR("get_FileText")
}
Method setuFileText(ByRef p0 A
{
Do ..%I("set_FileText",.p0)
}
Method getuFilePath() As %ObjectHandle
{
Quit ..%IR("get_FilePath")
}
Method setuFilePath(ByRef p0 A
{
Do ..%I("set_FilePath",.p0)
}
Method FilePut(ByRef p0 As %
{
Do ..%I("FilePut",.p0,.p1)
}
}
Can anybody se whats wrong?