|
|
|
date: Sat, 4 Feb 2006 23:58:40 -0800,
group: microsoft.public.dotnet.datatools
back
Re: Post success message back to the sender
Hello Jack,
You need to create class that implements IPlaybackControl interface and methods
FinalClientRetry, FinalServerRetry. It class itself is a component that can
be installed both on the client and server systems.
FinalClientRetry called when message can't be delivered to the queue.
Samples implementation is below. This component needs to be associated with
the queued class using [ExceptionClass] attribute
smth like
[ExceptionClass("Samples.Courses.Services." +
"ErrorHandlerCourseControl")]
public class CourseControl: ServicedComponent,
IQueueableCourseRegistration
{
implementation is here
[ConstructionEnabled(true, Default="d:/demos/MessageLog.txt")]
public class ErrorHandlerCourseControl: ServicedComponent,
IPlaybackControl, IQueueableCourseRegistration
{
private string errorFileName;
protected override void Construct(string s)
{
errorFileName = s;
}
public void FinalServerRetry()
{
System.Diagnostics.EventLog.WriteEntry(
"Course Services",
"Server error with queued component; logfile: " +
errorFileName);
}
public void FinalClientRetry()
{
System.Diagnostics.EventLog.WriteEntry(
"Course Services",
"Client error sending message to the queue; logfile: " +
errorFileName);
}
public void RegisterCourse(string xmlCourseRegistration)
{
StreamWriter writer = File.AppendText(errorFileName);
writer.WriteLine(xmlCourseRegistration);
writer.WriteLine("");
writer.Close();
}
}
J> Can you tell me what the code will be like to post to the sender
J> through exceptionclass. I dont know the post syntax.
>> To get returning data you have only two cases:
>> - use error components [ExceptionClass]
>> - implement another queued component on both the client and the
>> server system
>> J> I am receiving a XML file from a service/port.
>> J> Based on the contents of the xml file, I need to post back a
>> success
>> J> or failure message. I need to do that through my dotnet program.
>> Can
>> J> someone give me an example on how to post the message back to the
>> J> sender?
>> J>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
date: Mon, 6 Feb 2006 18:14:58 +0000 (UTC)
author: Michael Nemtsev
Re: Post success message back to the sender
thank you.
"Michael Nemtsev" wrote:
> Hello Jack,
>
> You need to create class that implements IPlaybackControl interface and methods
> FinalClientRetry, FinalServerRetry. It class itself is a component that can
> be installed both on the client and server systems.
> FinalClientRetry called when message can't be delivered to the queue.
>
> Samples implementation is below. This component needs to be associated with
> the queued class using [ExceptionClass] attribute
> smth like
> [ExceptionClass("Samples.Courses.Services." +
> "ErrorHandlerCourseControl")]
> public class CourseControl: ServicedComponent,
> IQueueableCourseRegistration
> {
>
>
> implementation is here
> [ConstructionEnabled(true, Default="d:/demos/MessageLog.txt")]
> public class ErrorHandlerCourseControl: ServicedComponent,
> IPlaybackControl, IQueueableCourseRegistration
> {
> private string errorFileName;
> protected override void Construct(string s)
> {
> errorFileName = s;
> }
>
> public void FinalServerRetry()
> {
> System.Diagnostics.EventLog.WriteEntry(
> "Course Services",
> "Server error with queued component; logfile: " +
> errorFileName);
> }
>
> public void FinalClientRetry()
> {
> System.Diagnostics.EventLog.WriteEntry(
> "Course Services",
> "Client error sending message to the queue; logfile: " +
> errorFileName);
> }
>
> public void RegisterCourse(string xmlCourseRegistration)
> {
> StreamWriter writer = File.AppendText(errorFileName);
> writer.WriteLine(xmlCourseRegistration);
> writer.WriteLine("");
> writer.Close();
> }
> }
>
>
> J> Can you tell me what the code will be like to post to the sender
> J> through exceptionclass. I dont know the post syntax.
>
> >> To get returning data you have only two cases:
> >> - use error components [ExceptionClass]
> >> - implement another queued component on both the client and the
> >> server system
> >> J> I am receiving a XML file from a service/port.
> >> J> Based on the contents of the xml file, I need to post back a
> >> success
> >> J> or failure message. I need to do that through my dotnet program.
> >> Can
> >> J> someone give me an example on how to post the message back to the
> >> J> sender?
> >> J>
>
> ---
> WBR,
> Michael Nemtsev :: blog: http://spaces.msn.com/laflour
>
> "At times one remains faithful to a cause only because its opponents do not
> cease to be insipid." (c) Friedrich Nietzsche
>
>
>
date: Mon, 6 Feb 2006 13:27:10 -0800
author: Jack
|
|