Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Sat, 4 Feb 2006 23:58:40 -0800,    group: microsoft.public.dotnet.datatools        back       


Post success message back to the sender   
I am receiving a XML file from a service/port. 

Based on the contents of the xml file, I need to post back a success or 
failure message. I need to do that through my dotnet program. Can someone 
give me an example on how to post the message back to the sender?
date: Sat, 4 Feb 2006 23:58:40 -0800   author:   Jack

Re: Post success message back to the sender   
Hello Jack,


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: Sun, 5 Feb 2006 15:38:25 +0000 (UTC)   author:   Michael Nemtsev

Re: Post success message back to the sender   
Can you tell me what the code will be like to post to the sender through 
exceptionclass. I dont know the post syntax.

"Michael Nemtsev" wrote:

> Hello Jack,
> 
> 
> 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: Sun, 5 Feb 2006 09:50:26 -0800   author:   Jack

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us