Showing posts with label WCF. Show all posts
Showing posts with label WCF. Show all posts

Wednesday, August 19, 2009

Power of WCF

WCF (Windows Communication Foundation) is Microsoft's unified programming model for building service-oriented applications that communicate across the web and the enterprise. WCF clearly demarcates development and implementation. There are various Hosting options available and is independent of the run-time environment in which the service is deployed, they are:-
  • Self-Hosting in a Managed Application
  • Managed Windows Services
  • Internet Information Services (IIS)
  • Windows Process Activation Service (WAS)
All the development part lies in the code while the implementation like the binding can be handled in the config file as Microsoft has abstracted a lot of plumbing work reducing the implementation time. By this way developer can concentrate on core logic and WCF takes care of data delivery in the most reliable, secure and high performance fashion depending on situation.

WCF has an integrated Logging mechanism that helps you log traces. In other technologies developer has to write custom solution but in WCF, all that you need to do is to enable trace by changing the config file.

To achieve security mechanism in WCF you have 3 implementation choices:

  1. Transport: Transport security depends on the mechanism that the binding you've selected uses.
  2. Message: Message security means that every message includes the necessary headers and data to keep the message secure.
  3. TransportWithMessageCredential : This choice uses the transport layer to secure the message transfer, while every message includes the rich credentials other services need.
After the launch of modeling edition I feel it gets easy to delegate work in a team. An architect can create a Data Contracts/Relationships, Message Contracts and Service Contracts. After that only the facade layer has to be made with some tweaks here 'n' there. In this way lot of architecture intricacies can be hidden from developer.

WCF does not replace MSMQ, COM+ or Web Services, it provides a declarative infrastructure for all forms of communication to and from the Windows platform. Using WCF, communications happen at designated service endpoints, and an endpoint can implement different protocols (such as Web Service, WS-* SOAP style services), encodings (such as Text, Binary & MTOM), and transports (such as MSMQ, Http, etc.).

With .net 3.5, it becomes even easier to provide RESTful endpoints (JSON, POX, RSS and ATOM). So the real powerful leverage shall be building services that can be consumed by a ASP.net web client as JSON while simultaneously being accessed by a business partner through a php web client using the SOAP protocol (with its full complement of WS-* implementations such as WS-Security, WS-ReliableMessaging, etc.)

Thursday, July 9, 2009

Php consuming WCF Service

At last now I have Php client talking to WCF Service... Now this is something special, Technology should always be platform and language dependent.

I have a WCF Service consumed by ASP.net client RESTfully and the same service is talking to php client in a SOAP way.

Perhaps i am not an expert in wcf right now so am more thrilled ;) Just a stepping stone.

Wednesday, June 24, 2009

WCF-JSON with ASP.Net-Jquery Client

As i have already shared that i have been working on making a wcf service layer and that shall interact with open source UI layer... Has a milestone now, earlier we used to make a wrapper layer which used to act as intermediate layer cuz i dint wanted any change in actual HOST project and behaviors of the same.

Now we shall get rid of old JSON layer and our new RESTful host will start serving us.

Tuesday, June 23, 2009

Ideas and More Ideas!!!

I want to make a framework where i make wcf based REST services and consume it in various UI framework including php, jsp Etc, depending on the situations. I have already started the basic framework...

I feel that shall be the best use of REST... I need to start working harder now.

Sunday, April 26, 2009

We got rid of ScriptManager and jQuery $.Ajax is In

We took another major step to make jQuery the new way of life in our Product. Earlier we were using ASP.Net libraries and ScriptManager (bundle of useless java script). I might sound harsh on ScriptManager and ASP.Net all through the post, but it just goes to show that how much it has hurt in past. 

We have REST Layer, where in we publish WCF Services and in Client we used to register by the help of  Script Manager. In turn it used to download at least 400 to 600 odd kb of js. I am not negating the power of script manager. But i feel bundling everything in one library is very painful for people who will only use some percentage of it.

We tried lot of ways to enhance performamce, it came to a level when we removed script manager control and added end js on aspx page. But still there was nothing in return. So now we removed Script Manager and are using $.Ajax functionality of jQuery.

Thats why i liked jQuery, its a pretty neat and structured way to categorize usage. Although its all java script, syntax and language is easy and worth using. I cant stop mentioning that end performance is phenomenal.

Am not giving much examples here, Read Rick Strahl Blog for implementation.

Friday, March 6, 2009

Mission jQGrid is Complete!

So at last everything is complete with jQgrid. Along with busy delivery pipeline i managed to clear all the remaining hurdles and now Grid talks to WCF Services, passes JSON Stream has following features.

-- Multi select (Check box)
-- Master details
-- Grid as sub-grid
-- Add/Edit row
-- UI Date picker
-- Searching data
-- Inline Editing
-- Controlling server errors
-- Multiple toolbar search
-- Search Big Sets

Right now the REST services are talking to our local wcf services. Will make a demo thing and post soon. This surely helped me a lot, jQGrid Help.

Monday, February 23, 2009

Basic jQGrid Implementation with WCF Service

I have made a very generic and simple working model of jQgrid with wcf service. You can download it from here.

I am working for a complete working model. Will upload it once its done.

Thursday, February 19, 2009

Paging for jqGrid for WCF implementation!!!

Past 1.5 months had been too hectic for me. Some of them were due to major happenings in personal life. Will step into married life in early april. At workplace was too consumed in regular releases of product. 

At last the paging issue for jqGrid was solved. Last night i cracked the paging details were embedded  in Message Header... and today i parsed and basic grid is comepleted... I need to post the solution now. Will do it by tomorrow. Have started working on fully functional POC. Might take a week. :)

Tuesday, January 13, 2009

JqGrid with WCF REST Service

We have WCF services implemented for thick and thin clients. But as the dynamicity increased we started to wrap those services around REST based WCF Services majorly for Web Client. Now am slowly getting rid of any ASP.Net code written at client. I know its pretty mean of me, but I don’t feel the sense to do it.

I am waiting for ASP.Net MVC to be integrated nicely in VS and then probably think of something in ASP.Net. There might be a situation where in we have client totally independent of any web technology :) That will be powerful for sure. Future is WCF Services and client rich applications that how I look at it. 

I started to implement my Services with jqGrid yesterday and could complete the services part and Client Grid in hours but it took time to integrate it all and see my data rendering in Grid. I won’t blame on poor documentation of jqGrid but yeah it took 6-7 hours for me to implement the same. I can't whine now cuz its working and working fine now. I found no place where this combo was even attempted. So wanted to contribute for the community as well...

I will upload the whole solution after some cosmetic improvements. If someone needs any help, post comments.

Script Code -------------------------------


HTML-------------------------------------------------------

    


    


REST Service -----------------------------------------------

 [ServiceContract(Name = "CandidateService", Namespace = "JsonCandidateService")]  

    public interface IJSONCandidateService

    {

        [OperationContract]

        [WebInvoke(Method = "GET",

                 ResponseFormat = WebMessageFormat.Json,

                 BodyStyle = WebMessageBodyStyle.Bare,

               UriTemplate = "Candidates/{criteria}"

        )]

        JQGridCandidatesResponse GetAllCandidates(string criteria);

    }

Thats it for now, shall upoad the full solution soon. Happy jQuerying :)

Monday, April 21, 2008

WCF- Remoting Comparision

Very informative post. WCF if used to the best affect, nothings better than the same.

JSON-WCF Conquered!

I struggled big time last week with installation of VS2008 and Ajax Libraries. Actually I had older version of System.Web.Extensions... That made life hell... And I used to get "Sys is undefined" most notorious problem with .Net 3.0. Then I installed VS2008 Standard Edition and everything settled out. I managed to make a POC for JSON Service which wraps WCF Service in turn. Right now I have some issues Dependency Injection. But am thinking of it again to use it or not. Right now I m just preserving the state in a static variable. Lemme work more to find a more structured solution for the same.
Now I am making infrastructure for my Project that shall use these Independent Layers. I was also thinking about using an environment variable according to which JSON service will be used or not.

Monday, April 14, 2008

JSON-WCF-AJAX -- Wondrous Combo!!!

Am working along with Patterns and Practices (now Codeplex) for around 2 years now... WCF came in Dec' 2006 and there started a new journey of Services... Last year they also integrated JSON with WCF which i believe would be big boost to ASP.Net developers. I will upload the code soon, till then if u r interested in the same visit Dino's Article.