473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Creative Solution to Connect Events to Web Service

TM
My problem is a bit difficult to explain, having a relatively limited
knowledge of .NET/C#, but please see if you can read between the lines.

I have an ASPX that, on load, initiates a call to a web service. The web
service attaches itself to a Win32 app's event (using a socket and
system.eventhandler), like the following:

connection.Listener.OnPublic += new PublicMessageEventHandler( OnPublic );

As far as I can tell, after that first web service method call (we'll call
Method #1), the events keep firing. Every time the socket app fires an
event, the eventhandler does it's thing.

I then have another method (part of the same class, in the same web service,
Method #2) that the page calls on interval to check in and see which events
were fired. I attempted to make Method #1 store its messages in a Session
object (actually an array in the Session object):

#1 (simplified):
Session["message"] = (string) StoredVal;

#2 (simplified):
RetrievedVal = (string) Session["message"] ;

Then #2 would pick them up. #1 can store, but #2 errors with something like
"must be set to an instance of an object". I realize that these are in two
entirely different contexts (#1 is HTTP and #2 is attached to Win32), but is
there a way to have the two communicate?

Just for fun, I tried making both use an ADO connection and communicate that
way and it works, but I would prefer a memory object of some sort (ie.
Session, XML, DBM, shared memory, etc.) I really have no idea what I'm
talking about, so I'm hoping someone can pose a creative solution. Please
include actual code in your post (sorry, I can't -- my code is very complex).

Thank you for your time.
Jul 21 '05 #1
1 1257
Don't have any code for you but the error message you
get means that you've declared a variable to be of a certain object
type by it's not been initialized with anything (not been "newed" - common
in VB .NET C# .NET etc.)

"TM" wrote:
My problem is a bit difficult to explain, having a relatively limited
knowledge of .NET/C#, but please see if you can read between the lines.

I have an ASPX that, on load, initiates a call to a web service. The web
service attaches itself to a Win32 app's event (using a socket and
system.eventhandler), like the following:

connection.Listener.OnPublic += new PublicMessageEventHandler( OnPublic );

As far as I can tell, after that first web service method call (we'll call
Method #1), the events keep firing. Every time the socket app fires an
event, the eventhandler does it's thing.

I then have another method (part of the same class, in the same web service,
Method #2) that the page calls on interval to check in and see which events
were fired. I attempted to make Method #1 store its messages in a Session
object (actually an array in the Session object):

#1 (simplified):
Session["message"] = (string) StoredVal;

#2 (simplified):
RetrievedVal = (string) Session["message"] ;

Then #2 would pick them up. #1 can store, but #2 errors with something like
"must be set to an instance of an object". I realize that these are in two
entirely different contexts (#1 is HTTP and #2 is attached to Win32), but is
there a way to have the two communicate?

Just for fun, I tried making both use an ADO connection and communicate that
way and it works, but I would prefer a memory object of some sort (ie.
Session, XML, DBM, shared memory, etc.) I really have no idea what I'm
talking about, so I'm hoping someone can pose a creative solution. Please
include actual code in your post (sorry, I can't -- my code is very complex).

Thank you for your time.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gervas | last post by:
As you are all aware the Web has had a major impact on application architectures. In place of closed monolithic enterprise apps we are experienceing radical new developments in distributed...
6
by: ankurw | last post by:
Hi All, I am experiencing a frustrating issue with hooking into COM events from a Windows service writting in C#. I create a COM object in the service and hook into an event exposed by the...
1
by: Nikolay Petrov | last post by:
I am going to write a windows service and i need some info. How is the right way to make it do thing as specified time? Should I use a timer, which checks the time and execute what it have to, or...
1
by: TM | last post by:
My problem is a bit difficult to explain, having a relatively limited knowledge of .NET/C#, but please see if you can read between the lines. I have an ASPX that, on load, initiates a call to a...
0
by: SammyBar | last post by:
Hi all, My problem is basic. I'm starting to try web services with Visual Studio .NET 2002, .NET Framework 1.0. I'm testing the following configuration for my project. It's a ASP.NET Web Service...
0
by: George L. Sexton | last post by:
MH Software, Inc. is pleased to announce the release of version 3.2.11 of its Connect Daily web calendar software. This is primarily a small feature release with a few bug fixes. Topics in this...
15
by: dylpkls91 | last post by:
I have been researching this topic and come up with some code to make it work. It uses SSL and requires the 3rd party package Paramiko (which requires PyCrypto). However, at this moment I have no...
2
by: Wimpie van Lingen | last post by:
Hey I have some more questions with regards to Remoting in .NET 2. I'm using TCP with the Binary formatter. My solution consists of 4 projects: - Class Library containing the server classes...
1
by: =?Utf-8?B?Tko=?= | last post by:
Hi everyone, Every now and then I'm receiving the error posted below. I"m routing all my traffic through mod_proxy (apache) to my asp.net 2.0 (w2k3) machine. I can't reproduce this error and my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.