Service Oriented Architecture using WCF - wcf

I worked with WCF services in our projects. We implemented most of the features as services in WCF and consumed from other projects which are web applications, desktop applications. Is this what SOA is ? Now I am getting some job oppurtunities who are looking for SOA developers, I am not sure if I can claim that I implemented SOA in the applications I developed. I read about SOA but could not get to a conclusion to my question. Can anybody explain me to clear my doubts ? Thanks for your help.

Whilst studying for the Microsoft 70-513 - Microsoft .NET Framework 4 Windows Communication Foundation, the term Service Orientated Architecture (SOA) is used quite often. The Microsoft book I have read states that;
"The architectural principles behind an SOA is the ability to reuse
existing software assets wherever possible and to expose the
functionality of these assets as a set of services."
So if you have used WCF to implement services into your applications, then it would seem you have experience in working with SOA.

My understanding about Service Oriented Architecture
We write WCF services which can be consumed by application written in
various technologies Desktop, Phone or Web.So, that we don't have to
write Service layer for each technology.
Many times it happens that your core business logic remains same for
years but, your UI or Client changes form Desktop to Phone to
Browser changes so, in this case you don't have to spend time again
writing same thing.
And as name it self say that it is service oriented so, if any
application which is able to consume services your winner.

Related

Multi-client architecture advice for RavenDB

When catering for multiple .NET Client Applications - say - Web, Desktop and then throw in an Android app (Java), placing the business logic behind some WCF REST API services can make it easier and quicker to build applications, as there is no business logic to implement client side for each technology.
(I know that there will be a point of changing the UI to cater for new business logic, but the idea is the core of the system sits behind an API, not in the client application.)
Although RavenDB serves as the Storage Mechanism...
What is the general architectural advice of using RavenDB behind SOA services? Is it just your standard IDocumentStore/IDocumentSession behind the WCF instance and go from there?
Yes, you can just use it like that.
Note that RavenDB comes with clients for both .NET and Java.

Understanding WCF from a layman's point of view

I am relatively new to WCF. I am developing Web application.
I am trying to understanding "Why WCF" and read many articles .
But in many places it has been mentioned "to developed service oriented architecture ,to asynchronously send data" without any detailed explanation / any basic example.
Can somebody please let me know one simple example in layman's term ,"Why WCF" so that I can appreciate its existence.
I have had conversations with many people but none of them were able to answer this basic question.
I am also aware that ,many hundreds of applications have gone live before WCF was there...
Suppose, you do have a task to make a procedure of recieving of the coordinate point (lat,lon) and and returning the picture of the surrounding area. Or to make a language translator from voise input to text output. These jobs could uses several servers with a lot of data and could makes some huge mathimatic calculations. But you procedure should me quick, platform independend, secured, protocol-independent, consumed by different technologies (Web, Mobile, Applications). And at the same time it should be easy to consume by the end users, which do know nothing about you. As the main aim of ASP to handle web requests and generate the html responses, so the aim of WCF is to supply the end user with some useful functionality, developed by another user, remotly.
The developer creates a service (WCF) where he specifies its adress, binding and contract. Knowing these parameters other developers can consume this service. They can consume it by ASP, SilverLight, WPF, WinForms or any other technology (even none-microsoft), using SOAP protocol.
From Wikipedia:
The Windows Communication Foundation (or WCF) is an application
programming interface (API) in the .NET Framework for building
connected, service-oriented applications.
WCF is meant for designing and deploying distributed applications
under service-oriented architecture (SOA) implementation. **
Architechture
** WCF is designed using service oriented architecture principles to support distributed computing where services have remote consumers.
Clients can consume multiple services; services can be consumed by
multiple clients. Services are loosely coupled to each other. Services
typically have a WSDL interface (Web Services Description Language)
that any WCF client can use to consume the service, regardless of
which platform the service is hosted on. WCF implements many advanced
Web services (WS) standards such as WS-Addressing,
WS-ReliableMessaging and WS-Security. With the release of .NET
Framework 4.0, WCF also provides RSS Syndication Services,
WS-Discovery, routing and better support for REST services. Endpoint A
WCF client connects to a WCF service via an Endpoint. Each service
exposes its contract via one or more endpoints. An endpoint has an
address (which is a URL specifying where the endpoint can be accessed)
and binding properties that specify how the data will be transferred.
http://en.wikipedia.org/wiki/Windows_Communication_Foundation
Useful resources:
http://msdn.microsoft.com/sv-se/library/dd943056%28en-us%29.aspx
http://www.wcftutorial.net/
http://blah.winsmarts.com/2008-4-Writing_the_WCF_Hello_World_App.aspx
http://blah.winsmarts.com/2008-4-Writing_your_first_WCF_client.aspx

Architecture for Services (WCF and Delphi)

I'm working on a project that will have two user interfaces. Web (asp.net MVC) and Desktop (Delphi 2010). It was requested by the customer, so we need to use Delphi.
We're thinking of architecture oriented by services, and so is WCF. To access WCF Services in Asp.Net MVC it is fine but what Need I do in Delphi? My principal doubt is, how to access a service in WCF using Delphi. Is there any way to make it easy?
Can my methods in service return IEnumerable or T[]?
Are there recommendations for this !?
Thanks!
The web services support in WCF provides many features which are not suported by Delphi - MTOM, WS-Addressing, WS-Reliable Messaging and WS-Security just to name a few. If you are designing both parts of the system (web service server and client(s)), you are in the happy situation that you can choose which features to use (as long as they are not dictated by other parties).
WCF fortunately does not 'dictate' to use SOAP. The Interoperability section in this Wikipedia article mentions for example WCF with standard XML (or RSS, or JSON). There is also a WCF binding for REST.
Planning a service oriented architecture is a tough task, so I highly recommend to read through the usual literature for this topic, and find a way to keep it as simple as possible and easy to test and evolve.
Maybe you can take a look at RemObjects SDK: it is a WCF-like solution, and you can use it for .Net, Delphi, Objective-C, PHP, C++, etc.
So you can build a server with RemObjects for .Net, for example TCP + Binary message for best performance (SOAP/XML is much slower!), and a Delphi 2010 client (even FreePascal is supported). Both sides (Delphi and .Net) are compatible with each other, even for the binary message!
My experience with RemObjects is very good: very easy to use and to build services (easier than WCF?), good support and quality etc.
One of the latest SOA framework for Delphi, is our Open Source mORMot framework.
You can use interface to define your Service contract, and access to them locally or remotely using named pipes, GDI messages, or TCP/HTTP. Your contract is defined as such on both client and server side, just like in WCF.
type
ICalculator = interface(IInvokable)
['{9A60C8ED-CEB2-4E09-87D4-4A16F496E5FE}']
function Add(n1,n2: integer): integer;
end;
It handles per-call, per-session, per-user or per-group instance live. See this sample code.
It is secure (with secure authentication at URI level), light and fast.
It uses JSON as communication (lighter than XML), and a RESTful access. It is ready to be consumed by AJAX or WCF clients (the latest after custom marshaling of the interfaces). It was optimized for speed and scalability (with advanced features like balanced custom hosting and per-interface/per-method access security).
The mORMot framework documentation has more than 800 pages, and some dedicated high-level explanation of Service Oriented Architecture design pattern in Delphi. It is integrated with a Client-Server ORM, so you have at hand all needed low-level tools to make a proper Domain-Driven application in Delphi, and other technologies.

What is service-oriented architecture?

What is service-oriented architecture?
SOA is way to develop service oriented applications and WCF is technology which can be used to develop service oriented applications. BUT SOA defines strict rules (known as SOA tenets) for applications. If you don't follow these rules you are building services but these services do not conform to SOA.
WCF allows you to develop plenty of types of services. You can develop interoperable SOAP services which conform to SOA or which doesn't. You can develop pure .NET services with non interoperable features and you can develop REST services.
Moreover in SOA service can have different meaning than in WCF. In WCF service is collection of functionality exposed on endpoints. In SOA the service can be whole application (set of WCF like services) - difference between small and big SOA.
SOA tenets are:
Boundaries are explicit - service doesn't share anything with other services (even database tables and data can't be shared)
Services are autonomous - each service is independent, can be separately deployed and versioned
Services share schema and contract, not class - services are described in WSDL, transported data are described in XSD, orchestrations (aggregation) are described in BPEL
Services compatibility is based upon policy - WSDL contains WS-Policies to describe configuration needed for interoperability
As you see especially first two tenets can be easily violated when building WCF service.
SOA is a way to design a complete solution, it is a set of commonly accepted practices for communication, state management, compatibility, etc. In software architecture specifically, SOA is a set of services (not necessarily Web Services) that are built independently to support a range of client applications. The modular design helps maintenance, business collaboration.
SOA also provides some guidelines for development:
Constraints over backward compatibility
Metadata exposure
Discoverability of services
On the other hand, WCF is just a supporting technology that helps you build the services in .NET.
You can create a SOA without WCF, just as creating a bunch of WCF services does not make your architecture a service oriented one.
Service Oriented Architecture is a software architectural concept where one or more services interact with each other. Here, service means unit of work to accomplish a purpose. For an example, selling online ticket for railways is a service, online hotel booking is a service, procuring online payment is a service etc. Now, let's consider a hotel company sells its rooms online from its own website. In this case the website is using a local service. The same hotel can also sell rooms through a third party travel portal. In the second case the third party travel portal is using a remote service or web service. Selling hotel bookings online through a travel portal is an example of a Service Oriented Architecture. In service oriented architecture two or more parties interact with each other using web services. Among them few are web service providers and few are web service consumers. A software component can be built by following Service Oriented Architecture by using web services.
WCF is a technology to build a service.
WCF is a technology which makes building services easier, and it works on all transports not only HTTP so it is more generic than Web Services which works only on Http.
SOA is just a method through which we can interact between different technologies like in .NET and JAVA using Web Services.
For this you have to be a knowledge in few things shown as follow.
XML
WSDL
UDDI
SOAP
after knowing these things you can easily apply this SOA

Guidance on .net web services

It's been a few years since I've done web services. I remember it to be fairly simply to create and consume one. In my current position, I work in a large organization and we use a lot of DB2 stored procedures the mainframe guy write for us to get at HR data.
I'm now starting on a new HR project and rather than having the same ol' data access code that is in most of our other HR apps, I suggested we write a code library DLL that did all this work and just use this DLL in our HR apps from here on out. Once I suggested this, my manager thinks this is a great idea, but he wants it done in web services.
My manager has now tasked me with researching options for securing these web services would be. He wants me to tell him if we should use WCF with this and if the Java developers in the organization will be able to use the web services I create.
I have done quite a few web searches and haven't found information that specifically answers these questions. Is there anyone here with experience in doing this and could answer the qeustions regarding the security, WCF (which I know little about), and interoperability with other platforms (Java)?
Thanks!
WCF is the current approach for building service end points in .NET apps. It's flexible in supporting different transport channels and protocols. You can certainly expose SOAP Web Services from WCF and use them from Java clients or anything else that supports XML.
The old way of doing that in .NET, simple ASMX Web services is deprecated in favor of WCF. It doesn't have all the bells and whistles of WCF but it's very simple to use. Personally, I still like it and use it in very simple Web services where WCF is an overkill.
As Mehrdad mentions (and I totally agree), WCF is the current offering my Microsoft for most cases.
ASMX is great and simple - but it's very limited in many ways:
you can only host your web services in IIS
you can only reach your web services over HTTP
security is very limited
WCF remedies this - and offer much more beyond that. You can host your WCF services in IIS - or self-host in a console app or Win NT Service, as need be. You can connect your WCF services using HTTP, TCP/IP, MSMQ, Peer-to-peer protocols, named pipes for on-machine communications and much more.
I'd definitely recommend you check out WCF and give it a spin. It's a tad more complex than ASMX, but it also offer just sooo much more capabilities and choices!
As for resoures: there's the MSDN WCF Developer Center which has everything from beginner's tutorials to articles and sample code.
Also, I would recommend you have a look at the Pluralsight screen casts on WCF - it's an excellent series going from "Creating your first WCF service" and "Creating your first WCF client" all the way to rather advanced topics. Aaron Skonnard very nicely explains everything in 10-15 minutes screencasts - highly recommended!