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


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

OnOpening event called twice using ServiceHostFactory for WCF service

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

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


View Complete Post


More Related Resource Links

Team System: Team Foundation Server Event Service

  

Use the Team Foundation Server EventService to create and manage event subscriptions or create a Web service to receive and process events.

Brian A. Randell

MSDN Magazine May 2008


InfoPath Workflow Task Form "Loading" event handler only being called after App Pool recycled.

  

I have a Workflow that is using an InfoPath task form.  In the "FormEvents_Loading" method event handler I have some code that needs to run each time the form is opened.   I recycle the App Pool and open the form the code runs perfectly, but if I close and try to re-open the form the code is not run at all.  I can then recycle the App Pool again and on the next load the code executes just fine.   The code that is supposed to be run is a very simple statement to set a field value, so I don't think it is interfering.

Does anyone know what this might be?

Thanks,
--Aaron


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.  

Getting AppDomain.UnhandledException event to work in a Windows Service

  
Nearly every forum thread I have found on "catching unhandled exceptions in a service" seems to end up where I am.  The supposed solution is the use of the AppDomain.CurrentDomain.UnhandledException event.  But it doesn't work for someone, who then asks why and gets no answer.  Same for me; I can't get the event to happen.  It's as if I need the ServiceProcess version of Application.SetUnhandledExceptionMode(), which doesn't exist. For diagnosing this, I start a timer in a child object of the service and then throw an exception in the timer event handler.  Simple enough to simulate the real situation.  I have tried subscribing to the UnhandledException event in at least a half dozen locations throughout the service, from the Program that runs ServiceBase.Run() to the constructor of the object that owns the Timer, but it never catches this exception. The VS debugger recognizes that the forced exception is unhandled and takes me to the place where is thrown, letting me know it is an unhandled exception. Why doesn't my handler catch it?  Running without the debugger, the exception throws, the timer thread crashes, the service continues merrily along, and nothing gets logged anywhere.  That is NOT the result I need.  What are the people for whom this works doing that I am not doing? How can I at least get the offe

FIMSynchronizationService can not start (event id:6324) and The Forefront Identity Manager Service c

  
Hi, I have this two issuses 2 days. I tried lots of ways, I can not fixed it. I have fully permission accunt to create User Proflie Sych. Even last week, everything is fine, but since I deployed the Sql2005 maintenance for our database. It shows those two issues. Please help!

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  

application_start event called multiple times in MVC application

  
hi, In my MVC application ,I am updating my web.config at runtime through application_start event.So, ideally it should be done only when the application is started.BUT in MY mvc application the application_start event of global.asax is being called multiple times , even when i have not restarted the application. Its being repetadly called when i am calling different actions , so the webconfig is repetedly updating & making my application very very slow. Can you please let me know , what's the reason & how to handle this .   Thanks in advance gbhatnagar    

The request failed or the service did not respond in a timely fashion. Consult the event log or othe

  

Hi,

           Actually i have installed SQL Server 2008 R2 on XP Pro SP3 it works fine after instaling first time but when i restarted my pc SQL Server Service didn't restarted and so i tried to restart that manuly by clicking start in Sql Server Configuration Manager at that it gave this error "The request failed or the service did not respond in a timely fashion. Consult the event log or other application error logs for details."

 

I tried to repair it again but it doesent resolved .So i Uninstalled it SQL Server 2008 R2 and all its shared tools and installed it again but nothing changed it again gave me the same problem as in 1st instalation after restating maching.

      Any idea! Where i am going wrong?.

i got this thing in Event log of Application

Event 1

"FCB::RemoveAlternateStreamsByHandle(BackupSeek): Operating system error (null) occurred while creating or opening file 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\transport.mdf'. Diagnose and correct the operating system error, and retry the operation."

Event 2

"FCB::RemoveAlte

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.

How to create wsdl proxy of web service with out event handler for .net compact framework 4

  

Hi All

i have one problem while access web service axis 1.4 in compact frame work

Create web service object using client

 MIScreenSoapClient ser = new MIScreenSoapClient();

create event handler for method to access web service

ser.GetLoginRequestCompleted += new EventHandler<GetLoginRequestCompletedEventArgs>(proxy_getloginrequest);
    ser.GetLoginRequestAsync(strLogin, strPass, Program.VersionNumber, "WM1", "test", "WP7");

Event Handle for method

 void proxy_getloginrequest(object sender, GetLoginRequestCompletedEventArgs e)
  {   
   string eee = e.Result;
   
  }
is there any way to access webservice without call event handler?
Please help me




Vignesh>>>k

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

  

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

is there a event called 'ondrop'?

  

hi,

i'm using dragpanelextender,and,i want to save the position of the panel to the profile after user drop it,

but i'm wondering which event should i use to do the saving

i tried onmouseup,but it doesn't work in IE--user triggers the onmouseup event only if they didn't move it!

this post,http://forums.asp.net/p/1188549/4134284.aspx#4134284,tells that there's a event called "ondrop"

but my vs and browser told that there's no such thing.

so,what should i do to deal with this problem.

thx for any suggestion and examples.


How to trace to the event log from a WCF Service hosted in a Window Service.

  

Hello,

I have a C#.NET Windows service that I use to host my WCF service. The Windows service basically does nothing but trace some event messages to the event log and host the WCF using ServiceHost.

Is there a way to have my WCF service also trace to the event log? How do I pass parameters to my hosted WCF service? Can I pass parameters? Do I need to use a service contract instead?

 I am new to WCF and WF so let me know if I'm missing something stupid here.

Thanks,

Sheri


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?


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