473,383 Members | 1,798 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,383 software developers and data experts.

InstanceContextMode.Single + OperationContext.Current

Hi all,
i have a WCF service for USB communication. I need to instance it as a
singleton class so i do:

<ServiceBehavior(InstanceContextMode:=InstanceCont extMode.Single, _
ConcurrencyMode:=ConcurrencyMode.Multiple)_
Public Class myService

....

End class

And that's OK! But I also need do define callbacks to signal events so
I add a callback Interface and:

<ServiceContract(NameSpace:="http://Microsoft.Services", _
SessionMode:=SessionMode.Required, _
CallbackContract:=GetType(ImyCallback))_
Public Interface IService

...

end Interface

The problem is in the constructor method of Service'class where I've
to get the InstanceContext for the CallbackChannel. I got an exception
in this code:

public sub new

callback = OperationContext.Current.GetCallbackChannel(Of
IEasyBusCallback)() '<-Reference to an object not set up on an object
request

end sub

Note that class myService inherits another class that implements
communication

thanks

Jul 24 '07 #1
0 1732

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

Similar topics

2
by: Jen F. | last post by:
I have inherited a medical database in which there are multiple values stored in a single field (ie. "Current Conditions" field might contain 1-20 different conditions, separated by comma (ie....
2
by: Keith Patrick | last post by:
I have a web app that consists of a single page. It works a lot like starter kit examples of menu/content apps, and it has a sitemap associated with it. However, my app doesn't go from page to...
2
by: John Dann | last post by:
I'm retrieving some columns from a database with numeric values that fall comfortably within the range of the Single type and I'm tempted to use Single for the relevant column type in the retrieved...
2
by: Matt | last post by:
I have a client that transmits a file to us with many XML documents enclosed. The problem is that each is a different format and may have different encodings as they contain information from many...
5
by: BMeyer | last post by:
I have been losing my mind trying to parse an XML document (with nested child elements, not all of which appear in each parent node) into a DataGrid object. What I want to do is "flatten" the XML...
3
by: Mark Jerde | last post by:
VS 2005. When I google "CSharp single instance form" the returned pages usually use a Mutex or the VB.NET runtime library....
4
by: dgilbert | last post by:
I have a custom membership provider that I am using to authenticate users in a WCF web service hosted IIS. I want to be able to see any cookies that come across and save session variables, but I...
10
maxx233
by: maxx233 | last post by:
Hi, I'm new to OO and GUI programming and would like to know: what's a good standard way of creating an application that loads different function-content in a standard space on a single form? In...
7
hodgeman
by: hodgeman | last post by:
Hello thescripts forums users... I've found a lot of answers to problems I've had in the past from this forum, and this is the first mySQL query issue I haven't been able to find an answer from...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.