B
benkial
Below is a custom exception class that I created to be shared by my C+
+ and
C# code. It works fine till I need to pass the exception object
through Remoting: every time a FtException is raized in the Remoting
server side, the client got the following error (see below). Based on
my Google search, I did the best I can to have a constructor that
takes SerializationInfo and StreamingContext as input. But it seemed
that
client side still cannot get the constructor to deserialize
FtException object.
What did I do wrong???
Also, how do I write the construction (right now is just a printf
statemet so that I can pass the _errMsg, and _errNo members and
recreate the object on the client side.
Thanks in advance,
Ben
============================================================
[Serializable]
public __gc class FtException : public System::Exception
{
public:
String *_errMsg;
int _errNo;
FtException(System::Runtime::Serialization::SerializationInfo __gc*
info,
System::Runtime::Serialization::StreamingContext __gc* context);
FtException(int errNo, String* errMsg);
System.Runtime.Serialization.SerializationException: The constructor
to deserialize an object of type Ft.ServiceUtils.FtException was not
found.
Server stack trace:
at
System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object
obj, SerializationInfo info, StreamingContext context)
at
System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder
holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at
System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize(HeaderHandler
handler, ISerParser serParser)
at
System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler)
at
System.Runtime.Remoting.Channels.CoreChannel.DeserializeSoapResponseMessage(Stream
inputStream, IMessage requestMsg, Header[] h, Boolean bStrictBinding)
at
System.Runtime.Remoting.Channels.SoapClientFormatterSink.DeserializeMessage(IMethodCallMessage
mcm, ITransportHeaders headers, Stream stream)
at
System.Runtime.Remoting.Channels.SoapClientFormatterSink.SyncProcessMessage(IMessage
msg)
Exception rethrown at [0]:
at Ft.FTConsole.OptionsDialog.tbPolicyServer_KeyUp(Object sender,
KeyEventArgs e) in ....
+ and
C# code. It works fine till I need to pass the exception object
through Remoting: every time a FtException is raized in the Remoting
server side, the client got the following error (see below). Based on
my Google search, I did the best I can to have a constructor that
takes SerializationInfo and StreamingContext as input. But it seemed
that
client side still cannot get the constructor to deserialize
FtException object.
What did I do wrong???
Also, how do I write the construction (right now is just a printf
statemet so that I can pass the _errMsg, and _errNo members and
recreate the object on the client side.
Thanks in advance,
Ben
============================================================
[Serializable]
public __gc class FtException : public System::Exception
{
public:
String *_errMsg;
int _errNo;
FtException(System::Runtime::Serialization::SerializationInfo __gc*
info,
System::Runtime::Serialization::StreamingContext __gc* context);
FtException(int errNo, String* errMsg);
System.Runtime.Serialization.SerializationException: The constructor
to deserialize an object of type Ft.ServiceUtils.FtException was not
found.
Server stack trace:
at
System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object
obj, SerializationInfo info, StreamingContext context)
at
System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder
holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at
System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize(HeaderHandler
handler, ISerParser serParser)
at
System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler)
at
System.Runtime.Remoting.Channels.CoreChannel.DeserializeSoapResponseMessage(Stream
inputStream, IMessage requestMsg, Header[] h, Boolean bStrictBinding)
at
System.Runtime.Remoting.Channels.SoapClientFormatterSink.DeserializeMessage(IMethodCallMessage
mcm, ITransportHeaders headers, Stream stream)
at
System.Runtime.Remoting.Channels.SoapClientFormatterSink.SyncProcessMessage(IMessage
msg)
Exception rethrown at [0]:
at Ft.FTConsole.OptionsDialog.tbPolicyServer_KeyUp(Object sender,
KeyEventArgs e) in ....