473,411 Members | 2,184 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,411 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 1258
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.