Monthly Archives: April 2013

Why You Would Ever Use SOAP Over REST (Why I Never Learned REST Web Services)

Most of my career I have dealt with Banking, High Integrity, HIPPA, PCI, and Financial data. When dealing with these kinds of data the main things you need to be worried about are:

  1. Ability to perform distributed transactional functions
  2. Verification of identity through intermediary (not just point to point IE. SSL)
  3. Standard implementation of data integrity and data privacy.

For the above data types the three things above aren’t a option you must implement them and SOAP does all three with WS-Security, WS-AtomicTransaction, and WS-ReliableMessaging.

REST is limited by the HTTP protocol itself and the stateless nature of the web for things like transactions and expects you to handle errors in communication. SOAP on the other hand provides two-phase commit across distributed transactional resources, has successful/retry logic built in, non-repudiation through signed messages, and support for signature formats: SAML Certificates- Kerberos tickets-x.509 certificates. SOAP also has the ability to encrypt the messages itself and a few other nice features such as attaching security tokens built in natively. This combination of things along with proper use of ciphers, formats, and algorithms leads to what is called end to end security which is a requirement for the above mentioned data tpyes to be compliant with industry standards and in some cases federal law. For anyone who does not need these things REST is great but for secure data, strong typing, and support for numerous security mechanisms to ensure safe use and reliable data you use SOAP.


Tags: , , , , , ,

Problems With IE 10 and X-UA-Compatible meta tag

So as a lot of you prob know Microsoft has pushed IE 10 in a KB release on Apr 9th. For some of us this has caused a headache because there is a issue with how the

<meta http-equiv="X-UA-Compatible" content="IE=8" />

tag is interpreted and we use this as developers sometimes for SharePoint, Dynamics CRM, and using some older libs in web apps for certain pages. Now the answer for us was removing this tag as it was for code I rewrote long ago. But lets get to the underlying cause. so if you make a demo page and place this tag in the meta, then put two text boxes and attach js validate 1.1 to the boxes and make one required and one not. When you submit the page you will see both will show up as required. So lets hit F12 and see whats up with the rendering.

OMGS what is this (credit to Corey Peters his image looked better than mine so I stole it.)

So as you see in the screen cap above IE 10 is getting the Doc Mode correct but not the Browser Mode. This is great for those who have been pushing Microsoft for proper web standards but man they could have put out some warning instead of putting IE 10 in a KB so it would have been more apparent when skimming over upcoming WSUS that IE 10 was coming. This causes issues in rendering as the doc type clashes with the browser mode in how the page is processed/handled by IE breaking quite a few JS libs.

If you are experiencing these issues you can either remove the tag if it is not needed, detect the browser and display a warning, or look at your code and fix the issues that are holding it back from IE 10. In the short term you also can do the following.

1. Use a loose instead of strict doctype
2. Validate your markup and make sure it is correct
3. Add a site to compatibility mode view settings
4. change tag to

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

If that does not work you may have a long road ahead. Stay strong my friends and till next Microsoft update don’t let your code have a meltdown.

Leave a comment

Posted by on April 15, 2013 in ASP.Net, C#, HTML


Tags: , , , , , ,

How to use a method with a parameter in a ThreadStart Call without ParameterizedThreadStart

So I am working on a Multi-Thread windows service and when I start the service I need to pass a string parameter but I ran into a issue, ParameterizedThreadStart does not allow multiple parameter passing and you get no compile-time checking without having to cast from object all the time.
So whats the solution? Lambda expressions my friend Lambda expressions.
So here is how you do it and the benefits are that you can pass multiple parameters and you get compile time checking out of the box.

string clientName = "MyClient"
Thread myThread = new Thread(() => getClientFilesAndImport(ClientName));

in C# 2.0 you would use this as I have been told it does not work outside of 4.5 by a few people

string clientName = "MyClient"
Thread myThread = new Thread(delegate() { getClientFilesAndImport(ClientName); })

and there you go full implementation of parametrized methods in threads you spin off 🙂 without all the pitfalls.

Leave a comment

Posted by on April 1, 2013 in C#


Tags: , , ,