How can we user NserviceBus with WcfRest using SqlServerTransport? - sql-server

I want to create a WCF Rest Application using NserviceBus and also i want use SQLServer transport.
Kindly help me ..Give me some Proper Code

NServiceBus V5.x - SQL Transport V2.x
The following sample shows you how to setup the SQL transport:
https://github.com/Particular/docs.particular.net/tree/master/samples/sqltransport-nhpersistence/Version_2.2
Hosting in IIS
NServiceBus can be hosted in IIS without any issues. Especially with a central broker transport like SQL, RabbitMQ, Azure Storage Queues or Azure Service Bus.
http://docs.particular.net/nservicebus/hosting/#self-hosting-web-hosting
NServiceBus can be hosted in any web technology that support .NET. This includes:
ASP.net
ASP.MVC
WCF
Web API
NancyFX
And many others.
As most web technologies operate in a scale out manner NServiceBus is usually hosted in a "Send-only" manner. In this mode they act as a "forwarder" of messages rather than the "processor". So the handling code (MVC controller, NancyFX module etc) of a given web request simply leverages the Bus send APIs and no processing is done in the web process.
Hosting in IIS does have some concerns as application pools by default don't startup automatically and can be recycled or even stopped. Any messages send to such an IIS hosted endpoint will not be processed until the application pool is started again.
MVC
The following samples demonstrate how to initialize NServiceBus and how to use it from MVC
http://docs.particular.net/samples/web/asp-mvc-application/
http://docs.particular.net/samples/web/asp-mvc-injecting-bus/

Related

How to secure database access in mvc web application

I am developing a web application in ASP.NET MVC, iOS and Android app using Xamarin that would have a common SQL Server database. I would want to develop a common layer/object that will have functions and methods common to all applications. I am also concerned about database security. I would want understand is there any other way in which this can be achieved.
I planning this roadmap :
I will develop web service or WCF services and host on a server, applications will communicate with these services and services will communicate with DB server.
If I develop web service or WCF service and host on a server, I want to prevent direct access and attack.
Which is better for my applications, web service or wcf service?
Masters please guide me.

Connecting project in Monaca Mobile restful api backend with mysql database

Connecting project in Monaca Mobile restful api backend with mysql database
I have a backend developed with php and mysql with various restful apis consultation, inclusion, exclusion ready. I need to connect the mobile project in Monaca this backend by apis from our server.
I'm trying different codes using angular, but nothing has certain data. If I can not make this connection will give up working with monaca.
Thank you!
Could not find a working rest example. This example connects to remote server and pulls data from a remote server. Changing URL should take care of the rest.
https://github.com/argelius/onsen-weather-sample

Azure Web Site with Push notifications

I'm trying to develop a Windows Phone 8 app. I've created a Web Site in a Windows Azure account which is an MVC 4 project with REST endpoints. I've got an SQL database in Azure to store data from the Azure Web Site. Ocassionaly, I want my application to send PUSH notifications to mobile phones. So I've created a Mobile Service and I've linked the SQL database with the Mobile Service's database in order to have got the same data for the web page and the service.
I though that when I send an HTTP POST to the web site, the script in the database from the Azure Mobile Service would be launched but it looks not to be true. Isn't it? Because of that, I would write in the controller of an HTTP POST endpoint the code to send the data to the Mobile Service endpoint in order to launch the JavaScript code to send the Push Notification.
Is that the right approach for my goal? Is there any way for sending PUSH notifications from an Azure Web Site or it is only allowed from a Mobile Service?
My last question: Do you know any books or blogs about development in Windows Azure? On the Internet there is lots of documentation but principally those are get started tutorials. I've read some books but those are really complex, boring, and not really practical.
As your website MVC4 based and is running on Windows Azure using SQL Database as backend, I will guess that it is based on ASP.NET and i will write my suggestion based on that.
Now about your question "Is there any way for sending PUSH notifications from a Azure Web Site or it is only allowed from a Mobile Service?" I would say, Azure Mobile web services are designed for the same purpose for any service running on Windows Azure to send push notification on multiple of platforms. Application developer can choose to use Mobile Services to expedite their development as well as have multiple application using the one single service for such objective.
However as you mentioned "Is there any way for sending PUSH notifications from a Azure Web Site" this is not depend on "Azure web sites" instead it is depend on what development technology you are using with your Windows Azure Application. For example in ASP.NET your can use SignalR implementation if your application is based on Java, PHP, Python, Node,js etc then you can find some other run time specific real time implementation. If you look around for websockets you will find implementation in almost every popular language or look for comet programming on this regard. Not only that you can use some of the popular 3rd party applications for this purpose as well. i.e. pusher or any other.
While Windows Azure Mobile Services will give you the best results on Windows Azure platform as it is designed to provide such specific functionality for applications running on it.
Recently released: Azure Notification Hub
http://msdn.microsoft.com/en-us/library/windowsazure/jj927170.aspx

Are there any hosted services for Socket.IO (or alternatives)?

I have a web application running on Google App Engine and need to provide near real time updates to connected web clients. One way would be to use the Google App Engine Channels API, but I'm a bit uneasy about using a proprietary solution.
Are there any reliable hosted services allowing for clients to connect using Socket.IO (with all its supported fallback protocols), and a web server solution running on Google App Engine to publish notifications to it? Any other alternatives that offers the same functionality?
You looking for something like beaconpush.com?
I have the same problem as you.
I've thought about using the Channel API as well however the free quota is quite low (100 channels created per day, each client is one channel).
Here's the solution I'm building:
All of the server logic runs in app engine python runtime
app engine serves all the html and client code
I run a node.js socket.io server on dotcloud (using their free tier)
the node.js server sets up an http server that listens to get requests on a few special url endpoints (ie: myapp-on.dotcloud.com/room/[room_id]) and when it gets called it triggers the socket.io broadcast to the appropriate clients
html clients generated on app engine connect to my myapp-on.dotcloud.com
All user input in the client is sent to app engine via a normal ajax post/get
when the app engine server code needs to push something to the client it makes a url fetch on the appropriate url (myapp-on.dotcloud.com/room/[room_id]) that triggers a message push via socket.io to the connected clients
I'm yet to implement this, but sounds like a workable plan
the idea is to keep all the logic in app engine and only use the socket.io server as a message pusher

messages between local Silverlight apps without using local messaging

I have one silverlight application hosted in HTTPS and another in HTTP. How can I send messages between them? Silverlight's local messaging system can not send messages between silverlight apps hosted in different URI scheme.
Silverlight's local messaging system typicaly uses for communication silverlight plugins on the same page. So, you provide more complex scenario. You access to first via https and to second via http, as I understant each application hosted in an own page and you want provide communication between this application. I think you should use services to synchronize their on server.

Resources