Wednesday, October 2, 2013

Passing value of an array to WCF Test Client

This blog might look very simple but at least useful for first time users of WCF test client .
The Question here is how to pass the value of an array to WCF Test Client
Your Service Method method looks like the below ; you may notice that the method accepts a List<String> Values as input parameter .



Now Lets Run the WCF Project and see how it look like in the Test Client





Your Test Lists the method and its Parameters as shown in the above screen shot




Now Lets see how we can Pass the Values to the array . In Normal scenario you may not notice how we can enter the values . But you may notice one thing that the length of the array is Zero (0) .
Now change the length of the array to 2 and see what is the change happening



Now you can see the array value section is modified with an expander an you are provided with two options to enter the values




Enter the values in the Value field and test your service .


Happy Coding :)

Tuesday, April 2, 2013

MVC–Mobile View Rendering Issue–A Bug in MVC 4

Last month , we had a tough situation with one of our client projects which is developed in MVC 4 and it has got Mobile views equivalent to all the views .  Everything was fine until we deploys the final production version . After deployment the application behaved normally and the smoke testing was also went fine . But things went south when the next day the client reported a major issue with the IPhone/I Pad UI, as the desktop UI is getting rendered in IPhone . Lets think how weird it can be Smile . The team started the analysis and we absolutely don’t have any clue what could have happened . We analyzed the code deeply and can not find anything funky in it . That said we were absolutely stuck at that point . 

I had a quick meeting with the team after the discussion with the client and who was already upset on the issue .  We decided to lets give our final hope to Google and start digging in Google . Finally we found that there reported a known issue with MVC 4  regarding to Display mode provider

image .

So finally we got some hope and we followed the steps mentioned in the blog post mentioned in Microsoft web site .

http://blogs.msdn.com/b/rickandy/archive/2012/09/17/asp-net-mvc-4-mobile-caching-bug-fixed.aspx

There  is a patch from Microsoft as Nuget Package  which resolves this issue .  To install the Nuget package please follow the steps below

image

Now how do we test this . Also please note that this issue can’t appear in debug mode . For testing we have a sample windows application , where it launches with two browser windows embedded . We have created two instances of our application one with the patch and the other one without it , published in release modes and hosted in IIS . The embedded browser in the windows app first refresh after 20 minutes and after that every one minute . This way we were able to prove the fix was working  Smile.  

Please feel free to post your comments and questions .

If you need any help on the above blog , please email me to sreerajr@orioninc.com

http://d4dotnet.blogspot.in/