Biztalk problem deserializing a custom exception
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > Biztalk problem deserializing a custom exception




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Biztalk problem deserializing a custom exception  
Ron J


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-25-05 11: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 ;
}

}
}











[ Post a follow-up to this message ]



    RE: Biztalk problem deserializing a custom exception  
Ron J


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:53 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register