Unit Testing Web Services using .net - wcf

I have wcf .net client to a webservice. I am trying to ensure that the connection to this web service is solid and that the web-service itself is sturdy and can stand up and take a pounding. I was hoping to hit it with 50 different asynchronous calls to ensure that it is working well. Is there a way that I can use the .net framework to make multiple asynchronous calls to the webservice?

If you're using VS 2012 you can use the built-in load testing
You can also use free tools such as LoadUI

Visual Studio 2010 (Test edition or Ultimate edition) has excellent support for performance and load testing (with plenty of extensibility points to meet your needs). Check the following blog for a series of links related to load and web performance testing:
http://blogs.msdn.com/b/edglas/archive/2007/12/17/content-index-for-web-tests-and-load-tests.aspx
A good approach is to use fiddler to record traffic between application and service and then export this into a web performance test.

Related

Bundle WCF service along with Universal Windows App

I realize that we cannot directly access SQL Server database from a UWP app, and have to use a WCF service as a mediator for this. (Which is totally stupid, since even competitors like MySQL provides API for Microsoft's runtime, while Microsoft's own RDBMS does not!)
I don't have any experience with WCF, but after going through some tutorials, I believe I can make a WCF service to communicate with my SQL Server (although I do not like making my simple application use a 3-tier architecture, which shouldn't be imposed on me). Anyways, I do not want to host this WCF service on my website, since I'm making this only for this UWP app. Is there a way I can bundle/pack this WCF service along with UWP app itself, such that service runs on client machine only when thhe start my app, and stops later when app is closed/suspended/minized.
The UWP app I'm developing, also have a WPF version and a web version (in ASP.NET), all of which were connected to MySQL database till now, and it worked flawless. Recently I decided to shift to SQL Server since I'm using Microsoft technologies for all my softwares and thought SQL Server will have better integration and support. But now I find it rather opposite, and thinking to switch back to MySQL database.
You can not bundle a WCF service (or REST api) with your Universal Windows app. UWP apps run in a sandbox environment on a different .NET runtime than your WCF service. You could run the WCF service in IIS, or even better create a self-hosted ASP.NET WebAPI project (so no need for IIS) to access your database. But this service will have to be installed separately from the app.
Note that because UWP apps run in a sandbox, some in-app databases like SQLite are inside this sandbox and can not be accessed by your other apps (WPF, website) by default (there are some hacks to bypass this).
So I think your best bet is to stick with MySQL and use the MySQL connector.

Agent based applications using WCF

i'm about to decide on technology choices for an agent based application used in the transportaion systems domain.
basically there will be a central system hosting the backend, and multiple agents located across town (installed on desktops) that communicate with devices/kiosks collecting data and then transmitting them back to the central server. the central server could also be hosted on the cloud.
following are important
securing the data and communications between the device and the agent
and the agent and central server.
agents should be easily installable with little or no configuration.
near 100% uptime and availability
Does WCF fit the bill here?
if so what binding types should i go for? netTCP or wsHttp with SSL/HTTPS?
WCF is definitely a fit choice for this kind of scenario. For your bindings, the actual question is what technology you are going to use. Do you want to make the agents run in a non .NET environment like Java, then you should chose for wsHttpBinding. This binding communicates through SOAP and is very interoperable.
If you chose to use .NET agents, you might as well use netTcpBinding because they use the same WCF frameworks. It also supports binary encoding. If you really need to make a choice, take a look at the MSDN Documentation.
For your agents you could use a simple console application that runs in the background as a Windows service. WIX can help you with that (install an application as windows service), but thats all I know. WIX can also help you with basic installing and configure everything for you but it has a high learning curve so you might need to invest time in it.

WCF Load Test with Visual Studio or any other free tools

We have a WCF web service and I would like to perform a load test. Could anyone please confirm if this is possible via Visual Studio 2010 or any other free tools?
Thank you
I have done a decent amount of this over the last five years using mstest and jetbrains dottrace.
What you need to do is write an integration test (a unit test that makes a call to your service) and then reference that in a load test. I then get dottrace to profile IIS and then rune the load test.
A free tool is available from CodePlex to load test WCF. To quote the project description:
This tool takes a WCF trace file and a WCF client proxy, or a WCF interface contract, and generates a C# unit test that replays the same sequence of calls found in the trace file. The unit test can then be used to load-test the target
You can with VS as long as you own the ultimate edition.

How to load test REST WCF service?

How can i load test REST WCF service?
Is it possible with Web performance testing and Load testing in Visual Studio 2010 Ultimate.
Please help. Thanx in advance.
This knowledgebase article has information on the tools available for stress testing web apps from Microsoft. I've used the Web Capacity Analysis Tool mentioned there in the past.
You can also look at the fiddler plugin stresstimulus. I've used fiddler for non load testing, but I have not used the stresstimulus plugin.
Disclosure: I work for StresStimulus maker.
In case you need to test with more than 250 users allowed by VS 2010 Ultimate, you can still record HTTP sessions in Fiddler, as described by #Nat, and then use StresStimulus for load testing in Fiddler. StresStimulus is not nearly as complete as VS 2010 Ultimate, but it’s free and you can check if it’s sufficient for your case. You can parameterize requests using .CSV files and load test with up to 1500 virtual users per client.
At the end of the day, a WCF web service still relies on good old http calls.
You are not really going to be able to record the webtest the same as for a webpage, but Fiddler will allow you to record the http calls made, so fire fiddler and then use the interface for your service to record some actions.
You can then save the fiddler http calls as a webtest for Visual Studio.
I personally would turn the test into a coded test so that items in the Webservice can be parameterised nicely, but it depends on what you need to do. Once a test is recorded, you can easily change the base url to point it to pre-production test environments or whatever is required.
Visual Studio 2010 Ultimate is a really nice tool for load testing and with 250 virtual users available for load testing, you can simulate a lot of actual users with it.

Desktop Based Application

What is a better platform/language for developing Windows/desktop based application that can run offline (sometimes)? .NET (C#, ASP) or Java or any other development tool? This application requires to store data into a database(involves some GIS) and later Synch both ways with the main server (SQL/Oracle) during off hours or when initiated by a user or event or when online? ALso the tool/IDE recommended should allow us in the future to migrate this desktop application as a Web based application to the corporate server with less pain or re-work when internet/nw access is available to all of our remote sites/users. Any input/advice is appreciated.
If you are strictly doing Windows desktop application development, C# or VB.NET would be an excellent choice. There is a ton of documentation out there for .NET developers. Although the framework is a free download from Microsoft, any serious work is cumbersome and tedious without the IDE.
If you needed the potential to support your application on multiple operating systems besides Microsoft Windows, then I think it might be worth looking into Java.
For web solutions, in .NET you have ASP.NET, Java you have JSP and Tomcat.
You could try Adobe AIR. It seems like it would serve most of your desktop needs and it should be the easiest to migrate into a web app (Flex).
C#/WPF for desktop with Silverlight, XBAP or even ASP as the online options.
Since you mentioned the desire to web-enable this application at some point I'd look into Silverlight. Out-of-browser capabilities were introduced in Silverlight 3. That means that the app can run directly on the desktop, and the internet connection is optional. However, when the internet connection is available it has built-in support for auto-updating itself.
And now in Silverlight 4 it's possible to run an out-of-browser Silverlight app with elevated trust. Silverlight 4 also finally introduced things like right-click support, clipboard access, full keyboard support in fullscreen mode, etc. So if you're just now starting development, I'd most definitely use version 4.
You'll have to communicate with something like a WCF service for a lot of the database operations. But going with Silverlight should allow you to build something that'll work on the desktop and the web alike without having to manage two systems.
Going web-based after you already developed a desktop application is a really bad idea. There is no reason the desktop application cannot use a internet connection, and be updated from a server.
You could try Delphi. It's a rapid application development tool. Very different, but very quick to use. Well suited to Oracle integration. Data sync is probably going to need to be custom, unless you're using something like Sybase SQL Anywhere.