.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

When is Dispose called for a ReleaseInstanceName.None Singleton WCF Web service?

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :WCF
 

Hello,

When is Dispose called for a Singleton WCF Web service with a default release instance? (That is, ReleaseInstanceName.None)

Has WCF changed recently with .NET 4.0?

I'm running a singleton WCF Web service with embedded "experimental" Python libs and cannot debug the service.

Thanks.

 


williamj


View Complete Post


More Related Resource Links

Trying to get SPSite when called through a web service

  

I have built a custom timer job that makes calls to a web service that I built.  The reason I built the web service is because I recognized that the sharepoint timer job does not have context for a site and I thought that by having the timer job call the web methods of the web service I could have the context that I desire.  This works great for accessing the web.config file, however, I have discovered that I am unable to get SPSite (SPSite oSite = new SPSite(AbsoluteURL)).  The constructor does not throw an error but I am unable to use the new object.  If I am able to get to the web.config and the site is a SharePoint site I figure I should be able to get an SPSite object.

I am trying to understand if I am running into a known scenario or if this should work and that I have a bug that I don't recognize.


WCF Service Function Getting Called Twice

  

Hi,
I have a WCF Web Service.  I am trying to test the service from a web form.  The web form calls the service using WebOperationContext.  The call successfully sends, however the web service function gets called twice while stepping through the code.  Nothing happens in between the first and second function call.  Not even setup of the Service.  The function itself is building a Generic List<Of Type T> and adding objects to the list.  The odd thing that happens, if I do not make the call to the add function, the Service function doesn't get called twice.  I'm including the network log collected from the network layer.  I can provide more source code if need be.  

Workflow Service 4.0 with One Way Receive activity will not get fired when called by a console based

  
Workflow Service 4.0 with One Way Receive activity will not get fired when called by a console based client application. This service does get called when there's the default ReceiveRequest coupled with a SendReply activity in the service. However deleting the ReceiveRequest and SendReply Activities and replacing it with a one way Receive Activity causes the Workflow 4.0 Service to not get called. Thanks, Leo Cono - http://www.YouLoveMe.com, Free Dating Site  

Slow performance of WCF service calling singleton (which calls COM+!)

  

Scenario:
WCF Service call routing to COM+ application.
netTCPBinding, throttling set pretty high.

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode=ConcurrencyMode.Multiple)] 

Service has two methods, one simply returns the string was input, the other calls the COM+ component and FOR TESTING returns the string "success" for every call. Therefore, both methods return a simple string.

Client starts 20 threads, each calling the WCF Service twice. (NOTE: A "first call" is made to prime the singleton service and also the COM+ component)

Using log4net and a Stopwatch to log the timings of the clien

WCF web service hosted in Sharepoint 2010 is called TWICE for a single client call. WHY??

  

We have WCF SOAP web service hosted in Sharepoint 2010 using service factory method and observe behavior which we cannot explain.

When authenticated web client invokes our service method “Generate” (synchronously) it is first get called with Anonymous credentials (SPContext.Current.Web.CurrentUser == null). Anonymous users don’t have enough permissions, so the first attempt of the service method to access a folder (SPContext.Current.Web. GetFolder("Shared Documents")) throws ThreadAbortException. But control does not return to the client. Instead the service method gets called AGAIN, now with correctly set SPContext.Current.Web.CurrentUser. Nowit works successfully to the end and result returns to the client.

 

The question which puzzles us a lot is WHY the service is called first time with Anonymous creds? We’d rather avoid this first invocation if possible.

WCF web service hosted in Sharepoint 2010 is called TWICE for a single client call. WHY??

  

We have WCF SOAP web service hosted in Sharepoint 2010 using service factory method and observe behavior which we cannot explain.

When authenticated web client invokes our service method “Generate” (synchronously) it is first get called with Anonymous credentials (SPContext.Current.Web.CurrentUser == null). Anonymous users don’t have enough permissions, so the first attempt of the service method to access a folder (SPContext.Current.Web. GetFolder("Shared Documents")) throws ThreadAbortException. But control does not return to the client. Instead the service method gets called AGAIN, now with correctly set SPContext.Current.Web.CurrentUser. Nowit works successfully to the end and result returns to the client.

 

The question which puzzles us a lot is WHY the service is called first time with Anonymous creds? We’d rather avoid this first invocation if possible.

Best method for authentication with an external WCF service called from a Silverlight 4 Web Part ins

  
If we have a Silverlight 4 application which gets its data from an external WCF service and is deployed as a Web Part on in SharePoint 2010 what is the best method to perform authentication in the WCF service itself.  The service is not on the same domain as the SharePoint server but any user authenticated by the SharePoint server (and only those users) should be able to access the service.  Since the Silverlight application is calling the service the WCF service itself must be configured to use BasicHttpBinding which, of course, severely limits possible authentication methods.

OnOpening event called twice using ServiceHostFactory for WCF service

  

It seems that when a WCF service, hosted in IIS7, uses ServiceHostFactory for activation and Auto-Start is enabled in the application, then the CreateServiceHost method is called twice. If Auto-Start is disabled then it's called only once.

 Is this expected behavior? Is there a way to suppress this?

This is a problem because it loads two instances of a ServiceHost derived class and code in its OnOpening and OnClosing events executes twice.  I need the a

Best way to "ensure" that an ASMX web service is only called from AJAX on a specific ASPX page

  

I have an ASPX page which hosts a Custom Control.  That custom control needs to call an ASMX web service.  I would use a PageMethod, if the fact that I'm calling from within a Custom Control didn't preclude that. 

I'm looking for some guidance on the most effective way to try and lock down the ASMX call such that it will only succeed for my users calling it from my ASPX page - and not for anyone trying to call it from elsewhere.  I've seen various ideas around session variables and so on.

What's the expert view, please?


wcf singleton service

  

Hi,

I'd appreciate some newbie advice: I have created a wcf web service that downloads data from a trusted server on a regular basis and stores it in sql 2008. (I have another wcfservice (ria) that accesses the db data). Eventually these services will be hosted at some host provider.

I implement it as a singleton wcf web service. And it leaves me with 2 issues:

1) It is not instantiated before I access it. I need it to start along with the web site, because of the regular download thing.

2) Since it is just a downloader service, it doesn't need any serviceoperations, but I have to provide a dummy operation for wcf to accept it. I'd like to get rid of this dummy operation.

So, is there a way to do this, or am I on the wrong track here?

Best,

Joe


Joe

WCF service to be called from Windows CE

  

Hi

My goal is to have a windows mobile ask a server about a list of products. The server could be behind a firewall, NAT, citrix and who knows what else.

So, to achieve this my current solution is to self host in a windows service as local system. This works in my development environment but probably not in real world scenarios.

I don't want any support calls regarding connection problems, so my current thought is to host the web service on the internet. In that way, I have a windows mobile device and a server that only needs outgoing connections on port 80, which I believe is what a browser does. Now this is fine, but complicates my solution. This means that instead of a simple GetProducts() call, I need some kind of command/polling architecture. This is the point where I am confused as to what is possible with WCF.

What I currently think is like this:

For my device to get its products, it calls the webservice with a getProducts() call. The web service "blocks" the call and holds a state (memory or file?) about object device id and a command id. The server polls every 10 seconds or so and now detects a command id telling him to deliver its products, which it does. The web service receives the products and continues the execution path and returns them.

This surely has to be done in an easier way? All

Singleton Design Pattern in C#, Vb.NET

  
Ensure a class has only one instance and provide a global point of access to it.

Windows Service Applications Tutorials

  
You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

WCF Tip: Using Properties in Service Contracts

  
you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

Realizing a Service-Oriented Architecture with .NET

  
This article is meant to be a practical discussion guide to building a .NET application in a service-oriented architecture. We will consider real-world goals, real-world obstacles, and experience-based solutions. I quickly concede the approaches discussed here are not exhaustive or infallible. This paper is focused on application development, not application integration. We will specifically consider architectural issues and component design issues.

The Potential of Web Services

Singleton Design Pattern in Asp.net using C#

  
When we want to make a only one instance of a class and also making sure that there is a global access point to that object then the design pattern we user is called Singleton. The pattern ensures that the class is instantiated only once and that all requests are directed to that one and only object.

Singleton Pattern-Creational Patterns

  
The Singleton pattern is a specialist creational pattern as it's primary focus is to facilitate a single shared instance of our object rather than to decouple our client from the object's implementation as with the other creational patterns.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend