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

Wednesday, March 26, 2008

Consuming WCF Services in BizTalk Server 2006 R2 - Add generated items (WCF Services)


I was thinking a long back to come up with this article, and now just found time to write about WCF services and it's implementation with BizTalk Server 2006 R2. I have designed few small solutions in past few months to deal with scenarios like Information Integration and SOA with BizTalk Server R2, where I found the great chance to work upon the WCF adapter series as well as Web Service Factory : Modeling Edition. Both made me big fan of them, it's great to work on both, I am not focusing on WebService Factory modeling in this article but will discuss about WCF services consumption inside BizTalk and few videos might help people to work on them.

I would like to share few images below, by reading this images you can understand the service I have coded for sample, if you are interested in sample code please mail me, and I promise you will find that sample someday in you mail box... when that I don't know. :-) But will try send you soon as possible for me.

The best way I feel to consume WCF services inside BizTalk solution is by using WCF Services Consume Wizard which you can find in Visual Studio Template, this wizard will power you by generating schema and port binding configuration files for your solution based on service descriptions. Not going into deep how this work internally here but focusing on the practice I gone through.

Below image shows Generated Items and Visual Studio Template.

Please have a look to the below Video Presentation where you can find what steps I followed to generate my sample project. Hope it will surely help you in any manner while working with WCF and BizTalk together.




As result of Wizard you will get schema and binding files inside your solution, that schema will be generated on basis of the metadata of the consumed services and it could be used as multipart messages in case of request-response services. Below snaps will show you the BizTalk schema presentation against the .net message contracts and data contracts.

DataContract Source Code:


MessageContract Source Code:


Service Implementation Code:


BizTalk Schema:



BizTalk Test Message I used for my sample:


You can analyze your self the presentation of Inbound message and the Contract representation inside WCF Implementation upon the above snaps. You can consume the generated schema in routine BizTalk solutions and patterns, while deploying such solution you can use generated binding information for such implementation with Endpoint transportation and Behavior information regarding WCF hosting and services. It is very good feature provided by wizard which make our life very easy :-). Let's have a view to below video presentation on the WCF Http and Custom Adapter configuration inside through BizTalk administrator console.



Hope you liked this article and it will give you fair idea about the BizTalk Server 2006 R2 and WCF coupling in Solution, as a system/solution designer point of view I really enjoyed to work with this two made for each other technologies and it provide such ease to workout most complex scenarios regarding service orientation and integration. As well as I realize the solution's capability to work over Internet Integration where security is the major concern and we generally prefers to go with ws-HTTP or HTTP channels for integration, on such scale it can help us to give such secured integration system.

Please provide your feedback about the article at nilayparikh@gmail.com.


Friday, December 21, 2007

WCF - Microsoft Service Configuration Editor – Services - SvcConfigEditor.exe

Microsoft announced very recently about "Oslo" and their strategies about Enterprise Integrations and Service Orientation. The announcement made me tempt to explore WCF (bytheway I started calling me WCF professional few months ago ;-) ), and I come across to a very good tool called "Microsoft Service Configuration Editor". So grabbed the opportunity to document something and let's publish ;-) please bare one more article…

While learning WCF the first thing came to my mind was Enterprise Services Management (This days I am playing my cards with Live Service Management), it's ok if you plan 2-3-10-20-50 number of the services for your business but when you are planning services in big bulk, distributed deliveries of services, different assemblies, managing behaviors/contracts/endpoints for various clients/hosts, etc…. there could be N number of the possibilities for various service management scenarios. And my thoughts and excitement brought me to the administrative tool called "Microsoft Service Configuration Editor". Microsoft is supplying this tool with "Microsoft Windows SDK v6.0A" itself, it's very useful tool for the service management (especially WCF).

WCF is saving configuration settings in web.config / app.config files and it's very hard to manage manually by editing.

Below I am just trying to put some screens and my tutorial experience to you, hope you like it.

Here for the demonstration, I am using the sample scenario called "TrustedFacade " which you can find in Microsoft WCF Samples ("\WCF_WF_CardSpace_Samples\WCF\Scenario\TrustedFacade"). Not going inside the code or development part, I am going to focus only on the deployment and administration with the Configuration Editor.

Steps, for configuring the service:

  1. You can open the tool from "Start Menu\Programs\Microsoft Windows SDK v6.0A\Tools\ Microsoft Service Configuration Editor" or go to the next path "Microsoft SDKs\Windows\v6.0A\Bin\SvcConfigEditor.exe".



  2. Click on crate a new service, it will bring you one service creation wizard.





  3. Click on the Browse Button and drive the wizard to the service dll, it can be GAC or File Location.



  4. After selecting the service, click on Next button, it will bring you to service contract page. It will show you all contracts available in one dropdown list in service, an appropriate contract you select and then move ahead with the next phase of configuration.



  5. Next screen will give you option to decide the communication mode, where you can select an appropriate mode of communication channels.



  6. Next screen will bring you selection of interoperability option.



  7. Now, the coming screen will ask you the address of your endpoint.



  8. After performing the above steps, now your wizard is ready to create configuration.


Now your service has been configured, the tool also provide facility to manage other configuration like hosts, base addresses, multiple endpoints, binding configuration, contracts, listening uri, etc. I am here just focusing on the service configuration, later on I will publish client and other configuration options available with in the tool. So let's coming back to services, the below image shows you, how to add multiple base location in host.

You can also add multiple endpoints to the service, as well as you can add certifications, identity and headers to messages and channels. Please check the blow screens to understand the configurations options for end points.


After completion of configuration you can save it as *.config file, which need to manage with services at the IIS/service hosting location.

This tool can give very good flexibility with the management and administration of the WCF services on large scale.

I will back with some more interesting articles on WCF as my study progress with it.

Thanks to bear with me during the article, please send your feedback to nilayparikh@gmail.com.

Cheers!