BizTalk Server General - Biztalk problem deserializing a custom exception

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > July 2005 > Biztalk problem deserializing a custom exception





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Biztalk problem deserializing a custom exception
Ron J

2005-07-25, 6:04 pm

I created a custom exception and the class has the [Serialize] attibute 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 ;
}

}
}






Ron J

2005-07-25, 6: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,SerializationFormatter=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] attibute 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 ;
> }
>
> }
> }
>
>
>
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com