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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

using MSMQ in Window Service

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :.NET Framework
 

Hi !

 I'm trying to implement MSMQ in a window service. But I've no idea how to do that, any help please ????

I'm using VS 2005. And what I'm doing is, right now all the request goes into the queue and from there the Serivce gets one by one and pass it on to the worker thread , and then takes the next one. what I want to do is incase a service crashes or is interrupted, the last request it has in the queue it should work on that again. For that so far I've understood that MSMQ is the solution, but I don't know how to do that actually .

 

Please help.

/Rashdan


Rashdan


View Complete Post


More Related Resource Links

problem in consuming WCF service through Window application

  

I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0


now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error

::::

The document at the url http://72.44.172.77/HRDev3/Service.svc was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'http://72.44.172.77/HRDev3/Service.svc' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: 'http://72.44.172.77/HRDev3/Service.svc'.

Content Type application/soap+xml; charset

Service for reading custom DLQ in WCF MSMQ 4.0

  
Hi folks, i want to write the web service that will be read messages from DLQ.   As i understand if the message can not be delivered(there are other cases such as timeout, authentication etc.) from Client to Service, then message will be placed to DLQ(in this case i use custom DLQ), and DLQ Service will be called automatically.  I wrote the 3 services: client, service and DLQ Service, but  when i turn off the service(server) and make client calling service, then message is not placed to DLQ(appropriate methods not called in DLQ Service). But when i turn on service messages are delivered to service.  My code below :  // server app.config  <?xml version="1.0" encoding="utf-8" ?> <configuration>   <system.web>     <compilation debug="true" />   </system.web>   <!-- When deploying the service library project, the content of the config file must be added to the host's    app.config file. System.Configuration does not support config files for libraries. -->   <system.serviceModel>     <services>       <service name="Service.MyService" behaviorConfiguration="Service.Service1Behavior">         <host>   

WCF Routing service with Backup List not working with MSMQ

  
Hi I developed routing service for round robin routing. I added backup lists to this routing service in round robin pattern in config file. My configuration is as below. <services>       <service behaviorConfiguration="routingConfiguration" name="System.ServiceModel.Routing.RoutingService">         <host>           <baseAddresses>             <add baseAddress="net.tcp://localhost/FDPRoutingService/router"/>           </baseAddresses>         </host>         <!--Set up the inbound endpoints for the Routing Service-->         <!--first create the general router endpoint-->         <endpoint address="" binding="netTcpBinding"                   name="NetTcpBinding_IFDService" contract="System.ServiceModel.Routing.ISimplexDatagramRouter"/>       </service>     </services>  &nbs

Problem with hosting wcf service using window service in window 7

  
Hi all! I have a wcf service, I hosted susessfuly in winxp, but in window 7, it throw an excaption like that Message="HTTP could not register URL http://+:8000/EchoService/. Your process does       not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). After that, I tried to run the  following command on window 7  to configure HTTP:             netsh http add urlacl url=http://+:8000/MyUri user=DOMAIN\userid I get error  Then, I run as Administrator and execute the above command, I get an error like here Create SDDL failed, Error: xxx The parameter is incorrect. I dont know why, and  how to fix the problem. Please help me!   Thanks all.    

How to Listen to MSMQ and Database table from a single WCF service

  
Hi, I have one WCF service which is listenibg to MSMQ. Once message is added to MSMQ, it will start processing the business logic. But my requirement is to make this WCF service to listen to one database table also. If any message is logged to this table or any message added to MSMQ, the WCF service should start processing the business logic. Could you please let me know if it's feasible using WCF service. It would be great if you can tell me the alternate approaches to implement this functionality. Ram.  .NET related discussions

Launch window forms app from windows service

  
I have a windows forms app that is used to manage settings for a windows service. When the service starts I want to launch the forms app. I'm using Process.Start("myWindowsApp") and I can see the app running in the task manager processes but the windows aren't displayed. My guess is that it's because the service is running under the localsystem account but what do I need to do to make the windows forms app work properly? SteveR

WCF Window Service Hosting

  

Hello,

now i am developing wcf services those will host on window service .In my project,there are several wcf services,                                                                          for example,CustomerService,SupplierService,SaleService,PurchaseService and TransferService.How i host those services on window service?                                 Will Each service acts as distinct window service?so,i have 20 services,are there 20 services in window service?After hosting,if i change some methods of  one service,do i need to uninstall all service?Please guide me and help me.I m not familiar with wcf configuration.sorry for poor of my english.

Regards

Aung


Error : Unable to connect to the remote server, When using web service in window service

  
Hi All,

          I want to consume a web service in windows service but in windows service I am not able to access  web service. I have tried it in windows application and web application it is working fine but in windows service  it is not accessible.

 

i am getting error:-   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)--->   at System.Net.HttpWebRequest.GetRequestStream()
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Testmachone.MachWebRef.SimCardWS.ProvisionImsiCard(String MsMin, String MsEsn, String CardId, String UserId, String Password, String MscId, String BId, String NewValue, ActionTypes Command, String MDN, String COS, String MIP_KEY, String MEID, String RADIUSPassword, String IMSI, Boolean PrePaid)

 any body can help me what could be issue

 
<

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


MSMQ Recieve Activty fails in workflow hosted in Windows Service

  

Hello,

I am trying to implement a windows service hosted workflow service that polls from a message queue. The message queue is is populated by a separate windows service.

I followed the post below for my hosted workflow as it looked to be close to what I was trying to do.

http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/aa2cee8c-8c7b-40d2-9b7a-0760aa556ebe

Following the steps in the post I was able to get my service to work when the message body was a simple string and using the WCFTestClient.

I then changed the code to use a a custom .NET object as the Recieve parameter instead of the string. The class library in which the object is defined was added as a reference. The service that populates my queue uses the custom .NET object as the message body.

In this scenario, the service would run but only process a message from the queue if it was in the queue before the service started. Any new messages added are ignored and if I add the message after I start the queue it also does not get picked up.

My xamlx is below, followed by my app.config:

xamlx:

<Wo

Need Help in window service timer scheduling

  

Hi All,

Here i have 3 rows in my table with the follwing data

WatchUrl                                                        SheduleType             Time

http://www. xxx .com/ abc /Welcome.html        Every Day            30

http://www.xxx.com/ abc /Captial.html             Every Day            1

http://www.xxx.com/abc/Histroy.html               Every week         2

What i have to do is to create a window service that call the webservice by pasing the url.the webservie will download the page content and  compare it with previous content if it differs i have to notify it to the user,that new content is added.i did everyting and its working fine .B

How to set MessagePriority of Msmq on wcf service with msmq binding.

  

Hi,

 this is a question when i use wcf for working.

 the wcf with binding msmq , is work fine.but I don't know how to set the MessagePriority.High,

and I can not set the wcf service method which executing first .

can u give me some suggestion,

best regards 

            loafer deng


xamlx workflow service initialization hosted in IIS on net.msmq endpoint

  

Hi everyone,

I implemented xamlx workflow service. I need to implement code that will be called before the service is invoked. I host workflow service in IIS on net.msmq endpoint. I saw that global.asax does not help me. I searched internet and found that I could use public static void AppInitialize(); method in App_Code folder class but that does not work.

Can you give me some suggestion or send code sample that can be used for initialization of application in iis that hosts xamlx workflow services on netMsmq binding?

Thanks,

Indigo Cowboy


Error installing Distributor service in EntLib MSMQ

  

Hi All

I am going to use MSMQ with EntLib 4.0,it needs a distributor service to be installed and I followed the way described in EntLib documentation but while running  installutil -i msmqdistributor.exe  commnad promt( Visual Studio) I get an error System.Management.ManagementException Access      denied. Can anybody help me to resolve this issue? or can anyone give me link how to use EntLib 4.0 for Asynchronous Logging? I need urgent help.


Error installing Distributor service in EntLib MSMQ

  

Hi All

I am going to use MSMQ with EntLib 4.0,it needs a distributor service to be installed and I followed the way described in EntLib documentation but while running  installutil -i msmqdistributor.exe  commnad promt( Visual Studio) I get an error System.Management.ManagementException Access      denied. Can anybody help me to resolve this issue? or can anyone give me link how to use EntLib 4.0 for Asynchronous Logging? I need urgent help.


How to send an object using MSMQ and WCF service C#?

  

I'm trying to send an object in a queue:

 

PurchaseOrder po = new PurchaseOrder();
      
      po.CustomerId = "somecustomer.com";
      
      po.PONumber = Guid.NewGuid().ToString();

      PurchaseOrderLineItem lineItem1 = new PurchaseOrderLineItem();
      lineItem1.ProductId = "Blue Widget";
      lineItem1.Quantity = 54;
      lineItem1.UnitCost = 29.99F;

      PurchaseOrderLineItem lineItem2 = new PurchaseOrderLineItem();
      lineItem2.ProductId = "Red Widget";
      lineItem2.Quantity = 890;
      lineItem2.UnitCost = 45.89F;

      po.orderLineItems = new PurchaseOrderLineItem[2];
      po.orderLineItems[0] = lineItem1;
      po.orderLineItems[1] = lineItem2;


      OrderProcessorClient client = new OrderProcessorClient("OrderResponseEndpoint");


      MsmqMessage<PurchaseOrder> ordermsg = new MsmqMessage<PurchaseOrder>(po);

      ordermsg.Label = "MY MESSAGE"

Webservice whose webmethod has to call a window's service and get back the results

  

I have a question which might be a beginner's question in .Net.

I have a webservice whose webmethod has to call a window's service and get
back the results.


What is the best way to implement this scenario.

I am adding reference to this windows service as an exe and i could not figure out a
way call its methods from webservice.

Please help me with a speedy reply

 Thanks in advance

Charpman
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