Friday, December 18, 2009

Developing Interoperable WCF

Recently I have been tasked with developing interoperable WCF services. My services are to be consumed by .net stack as well as by Tibco. As of this writing Tibco is not very supportive to WCF. Some issues are caused by WCF and some are due to laziness of Tibco. Following are the problems that I faced while developing this service:
  1. I was not able to get wsHttpBinding working with Tibco. Tibco has announced Support for WCF but I still to see that support in any of their product. I tried coordinating with our Tibco team but they were not able to get wsHttpBinding working. So we decided to live with basicHttpBinding. basicHttpBinding is very close to ASMX and having this binding means that you won’t have any funky thing possible with WCF. But it enables me to move to better binding once my clients are able to understand that.
  2. WCF does not include schema in one WSDL document. Rather WCF puts those schema into the network location and refer to those external locations in main WSDL document like this:
    <wsdl:types>

    <xsd:schema targetNamespace="http://tempuri.org/Imports">

    <xsd:import schemaLocation="http://localhost:1282/Service.svc?xsd=xsd0" namespace="http://tempuri.org/"/>

    <xsd:import schemaLocation="http://localhost:1282/Service.svc?xsd=xsd3" namespace="http://schemas.datacontract.org/2004/07/System"/>

    <xsd:import schemaLocation="http://localhost:1282/Service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>

    <xsd:import schemaLocation="http://localhost:1282/Service.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/Entities"/>

    </xsd:schema>

    </wsdl:types>



    Most of the legacy client tools won’t be able to recognize this. At least Tibco is waste and can’t understand it. My Tibco team has to manually download these schemas and then change the WSDL document to refer to those local schemas. This is a pain.

    There is a way to put all your WSDL in one document. There are tools such as FlatWSDL and WCFExtras which can pull all your schemas and put them together in one single WSDL document. But in this world everything comes with a price ;). Once you convert your WSDL to a single document schema, your WSDL loses some information in such a way that all collections become arrays. This is not good when you have .net stack also consuming your service along with non .net stack. Non .net stack anyway will get arrays but it would be good if .net stack can still see collections. More on this here....


  3. Designing exception handling approach. While starting to work on this service we had two options a) throw exception when we have exceptions b) never throw exceptions, instead respond to request and in response you let the client know that request was not processed successfully.

    Initially we went with first approach where we throw exceptions because Tibco didn’t want to introspect each message. This is good also because a broker should not inspect a message. This is basicHttpBinding so they are able to inspect; what if it was secure message? Brokers would anyway be not able to inspect message. But in this approach Tibco was not able to bind FaultCode and FaultString. This is because .net exception itself does not have FaultCode and FaultString as part of their data field. At runtime framework will populate these two fields. I tried working with FaultException as well but somehow that also didn’t help. Tibco team was not able to see FaultCode and FaultString in the schema of FaultException. I am not sure if I was missing something or my Tibco team.

    But due to this then fell back to plan B and now we are using response object to let client know that request failed. Now my response object have FailureCode and FailureReason that Tibco team can bind to FaultCode and FaultString.

This was my exposure interoperability and I consider this as a tip of iceberg. There is so much more to explore if you have more clients of different nature and you are planning to expose more bindings but all that for some other day.

Friday, November 13, 2009

Workflow Foundation 4.0 resources

This time I decided to remove some rust off my WF knowledge. I fired my VS 2010 and I was astonished. I could not see that familiar drawing board that was there in WF 3.0/3.5. It seems MS has changed WF runtime and designer upside down. On a broader level there are no breaking changes but whatever changes are there, they are making me bit uncomfortable with WF 4.0. A list of mapping of changes between WF 3.0 and WF 4.0 is listed here:

http://www.pluralsight.com/community/blogs/matt/archive/2009/06/26/mapping-wf-3-activities-to-wf-4.aspx

I searched for some resources on Workflow Foundation 4.0 and found one good site having some videos on WF 4.0. It is here:

http://www.cloudcasts.net/Default.aspx?category=WCF%20WF%204.0

And following is link to a post on http://stackoverflow.com mentioning some more links:

http://stackoverflow.com/questions/1371948/wf-4-0-resources-collection

Tuesday, November 10, 2009

My brush with patents

Now a days I am part time working on one project where we are evaluating server side image generation as one approach. So I was searching on libraries that could assist me in generating server side images that I can then serve to my clients. But it seems some guys are so !@$ that they have patented server side image generation. See it here:

http://www.encke.net/Article13.html

I was shocked to see that this can also be patented. Point here is that we (software developers) are doing it from so long. This application is submitted only in year 2001 and I am dead sure that this technique has been in public domain well before this application.

I am not sure how I will proceed, but going deep in this patent gives me a feeling inside that I can give this patent an escape on technical grounds. Anyway good to see that now I need to look out for patent infringement even for writing normal LOB software. ;-)

Monday, November 09, 2009

Fragile Agile

It has been around two year since I am working in Agile development environment. At our place we plan two weeks work and execute that plan. Any leftovers or new things are accommodated in next sprint. As some people think that waterfall model is dead and agile environment is silver bullet; I think the other way.

Lately I am feeling uncomfortable with all this agile stuff. As you might be knowing that in agile you have three key players 1) Product Owner 2) Scrum Master and 3) Developers. Developers are developers. Most of the time they just worry about their piece of code. Many of them can’t see the temple they are building. Scrum master is usually supposed to maintain some distance with the development. He is just enabler who removes any impediment of team. Now product owner has lots of stake here. He is the one who is answerable to all for the success/failure of the project. This guy is supposed to have a very close tab on entire development. If he misses any bit or not that competitive, that’s it… you will have a castle of sand.

Another point is to have good backlog of items. What was missed in past sprint and what are new items development team is picking up without conveying to product owner. Another problem I see with sprint planning and being agile is that you sneak in many non planned things at development time. Hence you might keep getting new sprints and see no delivery date.

My take is that there should be one master sprint (if you want to call it so) as well. This sprint will keep a track of all sprints. To some people this master sprint will give the feeling of a project plan. For me it is necessary otherwise you will be in a position where all sprints are complete but your product is still not in shipping state. To me agile is just a tracking mechanism which will let you track your project on a day by day basis so that you can take some corrective measures. But agile can not replace the wisdom of a human being. You have to be there as a manager (not one who just knows excel and outlook ;-)) to oversee everything and pitch in if something smells fishy.

Friday, September 25, 2009

Data recovery software

Some days ago I was playing with my laptop and trying to delete some unnecessary files. I don’t know who went nuts (I or my Windows 7), it deleted something that I did not intend. Basically it deleted all my photos taken in past 3-4 years. I was dumbstruck on that because data was around 25 GB and when Windows had asked for permanent deletion, I had confirmed it.

I could not do anything to undo this action because data was deleted permanently. Now my only option was to look out if any of my friend had any kind of data recovery software. None of my friend had any Symantec or other data recovery software. Then I tried looking out for free data recovery software and voila there are lots of them which can do recovery from multiple data sources. Following is the list of top 10 such data recovery software.

http://www.raymond.cc/blog/archives/2008/01/24/top-10-free-data-recovery-software/

As of now I am using Recuva and it recovered all my photos on Windows 7 OS with NTFS file system. Great work!!! Just 1 week back I formatted SD card of my camera. After formatting that card my wife asked for those photos. I properly remember that I had asked her and she had told me remove the content of that card. Huh, girls are girls!!! This time I am a hero because I have data recovery software. After formatting I had taken some more snaps and I knew that recovering everything will be difficult. In normal mode Recuva did not recover anything. But then it has one option “Deep Scan”. When I selected and re-ran the software, it found everything that I had formatted. Bravo!!! I am happy again.

Thursday, September 24, 2009

Web service testing; must have tools

Recently I have been involved in designing and developing interoperable web service. This service has to interoperate with Java platform and there is Tibco sitting in between. When it is all .net environment then you don’t need to worry about any web service testing things. It’s very easy; you develop and use it. There are no problems at all.

But when it comes to developing the service and giving to thirty party for consumption then you definitely need to do some basic test on your service. Two tools which prove themselves to be very useful are soapUI and WCF Storm. soapUI is very sophisticated tool to inspect your WSDL, invoke your web service. It can generate test cases for your service and it can even mock your service. WCF storm has many such capabilities like configuring the test case and saving them for later use. Both the tools are very friendly to use and have loads of features to help you when you are working with services.

One another tool is Axis2. I could not find a stand alone version of this tool. It comes as a plug in and it needs some Java IDE, hence bit difficult to work with it. 

Thursday, September 10, 2009

Windows 7 display driver problem

I have Dell Latitude D620 system that I recently upgraded to Windows 7 RC. It has nVidea Quadro NVS 110m display system. Everything went fine in installation. But when it started it started in very low resolution. Then I went to display properties and found that it did not list my native resolution that is 1400 x 900. I googled around web and found that nVidea has done some changes in their driver and they are no longer supporting NVS 110m for Windows 7. Dell is also not supporting Windows 7 on Latitude D620. So there I was stuck with Windows 7 having sub optimum resolution for my laptop.

Then I again searched for the issue that I had and I found I am not alone on the planet. There were many people who had issues similar to me. Gist of those searches was that Windows 7 has not changed anything on the ground for display driver. Meaning that I could really use Vista driver on my Windows 7. People had suggested that we can install those drivers in compatibility mode for Vista or Windows XP.

I then went to Dell site and searched for display driver for Vista and Latitude D620. I then installed it and it did not even complained about OS being different. That means when it comes to display subsystem, Windows Vista and Windows 7 are more or less the same. No breaking change. After installing this Vista driver on Windows 7 my system showed the right resolution for my laptop and for now my system is running fine too.