07-25-05 11:04 PM
Just in case anyone cares:
here is how I resolved this one; You must implement a constructor like this:
Sorry about the formatting.
Ron
using System;
using System.Runtime.Serialization ;
using System.Security.Permissions;
namespace CSTcpClient
{
/// <summary>
/// Summary description for CSTcpClientException.
/// </summary>
///
[Serializable()]
public class CSTcpClientException : Exception
{
private Int32 _faultCode ;
private String _message ;
private String _detail ;
protected CSTcpClientException(SerializationInfo si, StreamingContext
context) : base(si,context) {
_faultCode = si.GetInt32("_faultCode");
_message = si.GetString("_message") ;
_detail = si.GetString("_detail") ;
}
& #91;SecurityPermissionAttribute(Security
Action.Demand,SerializationFormatte
r=true)]
public override void GetObjectData(SerializationInfo si, StreamingContext
context) {
base.GetObjectData(si,context);
si.AddValue("_faultCode",_faultCode );
si.AddValue("_message",_message );
si.AddValue("_detail",_detail);
}
public CSTcpClientException():base()
{
//
// TODO: Add constructor logic here
//
}
public void setFaultCode(int faultCode) {
this._faultCode = faultCode ;
}
public int getFaultCode() {
return this._faultCode ;
}
public void setMessage(String message) {
this._message = message ;
}
public String getMessage() {
return this._message ;
}
public void setDetail(String detail ) {
this._detail = detail ;
}
public String getDetail() {
return this._detail ;
}
}
}
"Ron J" wrote:
> I created a custom exception and the class has the [Serialize] attibut
e at
> the top of the class.
>
> In the event log when I force and error to happen in the orchestration (to
> get it to try to dehydrate) I get
>
> Exception Type: ServiceCreationException
> The constructor to deserialize an object of type
> CSTcpClient.CSTcpClientException was not found.
>
> This is the exception class
>
> Does anyone have an idea about what this means?
>
> Thanks
> Ron
>
>
> using System;
>
> namespace CSTcpClient
> {
> /// <summary>
> /// Summary description for CSTcpClientException.
> /// </summary>
> ///
>
> [Serializable]
> public class CSTcpClientException : Exception
> {
> private Int32 _faultCode ;
> private String _message ;
> private String _detail ;
>
> public CSTcpClientException():base()
> {
> //
> // TODO: Add constructor logic here
> //
> }
> public void setFaultCode(int faultCode) {
> this._faultCode = faultCode ;
> }
> public int getFaultCode() {
> return this._faultCode ;
> }
> public void setMessage(String message) {
> this._message = message ;
> }
> public String getMessage() {
> return this._message ;
> }
> public void setDetail(String detail ) {
> this._detail = detail ;
> }
> public String getDetail() {
> return this._detail ;
> }
>
> }
> }
>
>
>
>
>
>
[ Post a follow-up to this message ]
|