Silverlight data-driven application with NHibernate - c#

this is more of a subjective Question, but I'll ask it anyway.
I'm about to develop a very data-centric application that has to run inside the browser. The frontend will be Silverlight, backed by a Fluent NHibernate service that runs server side.
The problem here is: Wherever I look for data-driven silverlight app I wind up finding Silverlight RIA services examples, but nothing on how to build this without some ADO.NET stuff involved.
I have little to no knowledge in WCF so far, but from the limited research I did it seems like WCF is pretty much the only way to let the client talk to the server.
Are there any tutorials/best practices on how to write a Silverlight MVVM app that provides CRUD for a non-EF database?
Suggestions would be very much appreciated. Thanks
PS: I can't use .NET remoting. The backend has to run on IIS6 :(

If you only need CRUD why not try REST via WCF
Otherwise create just a regular wcf. Walkthrough: Creating and Accessing WCF Services

There's a great series of posts from Brad A about using RIA Services at Business Apps Example for Silverlight 3 RTM and .NET RIA Services July Update Summary.
Some of these will be out of date, but it does cover using RIA Services from a collection of different data sources.

Related

When building web services for consumption as a client, does it matter what language is other party's application programmed in?

For example, my application is built in PHP & MYSQL and the service i am trying to consume, provide their .NET C# SDK samples on their website to help integerate. I am learning about PHP webservices. My question is, does it matter which language that other application uses? Does my application need to be in .NET C# as well ? or Web services and API's are inter operable across different programming languages ? Any help will be appreciated. Thanks in Advance.
No.
There's no need for the clients to be using the same framework or language as the Web Services that they consume.
Part of the point of Web Services is to enable machine-to-machine interaction in a platform-agnostic way. You shouldn't need to "know" about the underlying implementation in order to consume the Web Service, just how to call it. For example, you can consume a Web API RESTful service from Java, C, JavaScript, etc. and don't even need to be aware of the fact that they were using Web API as opposed to a different framework.
By analogy, if I call a friend on the phone, I don't need to know who his cell phone service provider is, what kind of phone he uses, or anything like that - I just need to know his phone number.

What are the limitations of WCF HTTPBinding?

I am developing a .NET application (say A) which will talk to other .NET applications (say B). The application A is going to be consumed by a Java application (say X). I am currently using Apache Thrift. Thrift is great except for the basic support for OOPS features (such as overloading and inheritance). Of course, we can customize the Thrift compiler in the way we want as it is a open source technology.
One of my friend suggested to use WCF for application A and to use WSHttpBinding. Does WCF service when using Basic/WSHtppBinding has any limitations other limitations to go ahead with that? I guess the limitations of web service are applicable for the above stated way of hosting. Please guide me in this.
I have worked on a few projects where we have had to integrate WCF and Java. I have always ended up going for the BasicHttpBinding as that has allowed the two technologies to communicate with the least amount of friction. You lose a lot by using BasicHttpBinding over WsHttpBinding but that has not been an issue with the projects I have worked on. You are going to have to make the call between ease of use (BasicHttpBinding) and support for more/newer standards (WsHttpBinding).
Take a look at http://www.codeproject.com/Articles/36396/Difference-between-BasicHttpBinding-and-WsHttpBind
Limitations of WCF are :
ASP.NET 4.0
Visual studio 2010
IIS 7.5
MS SQL server 2008 R2

Enterprise Web Services Directory

The .NET enterprise system I work with, has disparate web-services all over the place.
Some of them with test stubs/benches and excellent maintenance...and many others without.
The objective is to aggregate all the web services (asmx & svc) together and have them under a live test bench with smoke tests & unit tests to ensure their functionality. Preferably in an automated way too.
Is there an service aggregation software/system that caters to this aspect in .NET? What would be the best approach?
You need to check out SO-AWARE. It is a web service management tool that can manage SOAP or REST WCF-based service across your organization. Further it has a Test Workbench!
Here are a couple of videos that show it off too:
Part 1
Part 2
I'm not sure there is something like this in .net. All your services are made of different technologies asmx, wcf, rest ... and also different business.
First, you have to be able to fully isolate (code, reference, bdd) all these services for testing.
One solution for your problem could Visual Studio Virtual Labs : A lab environment is a collection of virtual and physical machines, which you can use to develop and test applications. It can contains multiple roles needed to test multi-tiered applications, such as workstations, web servers, and database servers. You can also use a build-deploy-test workflow with your lab environment to automate the process of building, deploying, and running automated/load tests on your application (full compatible with TFS)
A good start is msdn
One option would be to put a facade web service in front of all the separate web services. It may done programatically as a master pass through service or maybe even possible to use the WCF relay binding for this. I would also suggest taking a look a BizTalk. You should be able to setup canonical web services that maps to internal web services with proper mapping. You can even setup choreographed and orchestrated web service methods that as composed of multiple internal service methods. Security policy and logging can be applied centrally as well.
For testing I would seriously look as using SOAPUI PRO. I am extremely happy with this product. The only disadvantage is that it doesn't suport net.tcp binding. But you can have all your services exposed as basicHttpBinding in a test environment and run the test cases.

n-tier architecture approach asp.net web application clearing confusion

Well i want to know how many architecture approaches we can use in asp.net web application. i was asked about it. i told him that i use a appcode for dal and bal and the presentation layer. but he was not convince. basically i want to ask what web application architecture an asp.net web application guru would use keeping in mind the different metrics ( i am talking minus web services or any SOA thing)
Classic 2 tiers app
Is the one you described: You have the client (the browser) connecting to the server (can be configured as several servers) running an ASP app with your AppCode classes acceding the database in the local network (or same machine)
n-tiers app
You can use WCF to delived n-tiers app where the client connect to the server and the server connect to WCF services running on the same server or in several other servers
Note: This is the short story and the naming is subject to debate.

Is it possible to create a standalone, C# web service deployed as an EXE or Windows service?

Is it possible to create a C# EXE or Windows Service that can process Web Service requests? Obviously, some sort of embedded, probably limited, web server would have to be part of the EXE/service. The EXE/service would not have to rely on IIS being installed. Preferably, the embedded web service could handle HTTPS/SSL type connections.
The scenario is this: customer wants to install a small agent (a windows service) on their corporate machines. The agent would have two primary tasks: 1) monitor the system over time and gather certain pieces of data and 2) respond to web service requests (SOAP -v- REST is still be haggled about) for data gathering or system change purposes. The customer likes the idea of web service APIs so that any number of clients (in any language) can be written to tap into the various agents running on the corporate machines. They want the installation to be relatively painless (install .NET, some assemblies, a service, modify the Windows firewall, start the service) without requiring IIS to be installed and configured.
I know that I can do this with Delphi. But the customer would prefer to have this done in C# if possible.
Any suggestions?
Yes, it's possible, you may want to have a look at WCF and Self Hosting.
Yes, it is possible (and fairly easy).
Here is a CodeProject article showing how to make a basic HTTP server in C#. This could easily be put in a standalone EXE or service, and used as a web service.
One technology you might want to check out is WCF. WCF can be a bit of a pain to get into but there's a great screencast over at DNRTV by Keith Elder that shows how to get started with WCF in a very simple fashion.
http://www.dnrtv.com/default.aspx?showNum=135
You could take a look at HttpListener in the .Net framework.
I would highly recommend WCF. It would fit very well into a product like you are describing. There are a good number of books available.
Sure, you can do that. Be sure to change the Output Type of the project to Console Application. Then, in your Main function, add a string[] parameter. Off of some switch that you receive on the command line, you can branch to ServiceBase.Run to run as a Windows Service or branch to some other code to run a console application.
This question is somewhat older but since I needed something similar some time ago it felt like this question is still relevant.
I wrote a small Rest-API with NancyFx and OWIN. OWIN is a standard interface between .Net applications and web servers. With OWIN it is possible to create a self-hosted WEB-API. Nancy on the other hand is
a lightweight, low-ceremony, framework for building HTTP based
services on .NET ยน
The combination of those two makes it possible to create a self-hosted C# Web service.
I am quite sure that there are many more possibilities to create something like this by now but since I used it like this I thought the Information might be useful to someone.

Categories