I call the WCF method using the InvokeMember method. The WCF method accepts an integer and an out object as a parameter. this is the code in the WCF service:
public int SimpleTest(int n, out object OBJ)
{
OBJ = new Int32();
OBJ = 12;
return n;
}
when I use InvokeMember to call a function with parameters new Object[]{1 , obj}
, obj becomes 12 as expected.
but when the OBJ inside SimpleTest is set to a complex object (OBJ = new MyClass())
, I get the following exception on the page called the method: an Exception has been thrown by the target of an invocation.
internal exception indicates thatThe underlying connection was closed: The connection was closed unexpectedly.
I cannot understand why this exception occurred. can anyone explain?
source
share