Thursday, July 14, 2011

WCF Bindings summary

Thought to post this summary in here for my and others reference for Bindings

Binding

Security
Default Configurable

Transport Protocol

Encoding
Default Other

Host

basicHttpBinding

None,
Transport, Message, Mixed

HTTP

Text/XML, MTOM

IIS, WAS

wsHttpBinding

Message, Transport, Mixed

HTTP

Text/XML, MTOM

IIS, WAS

netTcpBinding

Transport, Message, Mixed

TCP

Binary

WAS

netNamedPipeBinding

Transport,None

Named Pipe

Binary

WAS

netMsmqBinding

Message, Transport, None

TCP

Binary

WAS

netPeerTcpBinding

Transport

P2P

Binary

 

Tuesday, July 05, 2011

Using Attributes VS elements

Thought to scribble here a little bit. Here is what I learned designing a XML object repository

1. For data use child elements don’t use attributes

2. For quarrying purposes – its ok to use attributes. I hate to write

if(attribute==null) –  Smile

Here are some things that I concluded

  • Attributes cannot contain multiple values, child elements can and so that later addition can be less code breaking
  • Attributes are not easily expandable -for future changes
  • Attributes cannot describe structures / hierarchies for data - child elements can
  • attributes are more difficult to manipulate by program code – LINQ / XQuarry works better with element. – that’s just me
  • Attribute values are not easy to test against a DTD

Tuesday, February 15, 2011

Oracle Connection with Visual Studio 2010

Pretty Simple Huh? not really.

here are the common tasks that you would like to do

(LINQ to SQL and entity framework not supported – Don’t even try it)

a. Connect the DB from VS to run some selects.

b. Create connection in code and get some data on web page.

There are 3 ways to go

1. Client side – System.data.OracleClient –> this is going away soon. so don not build you fortune apps on this. However, Visual studio uses this to connect. here is what you need (learned hard way)

  • Open VS, Data->Add new data source and select Dataset.
  • In add new connection dialog, you need to know the Host name of the Oracle server. (typically “HOST=” in your tnsnames.ora – on Oracle server)
  • you also need to know the SID which is nothing but the service ID. (typically “SERVICE_NAME=” in your tnsnames.ora – on Oracle server)

image

  • make sure that you enter servername/SID and use the test connection. – Success!

2. ODP.NET – oracle Data provider for .NET – a world in itself. More details and downloads here

http://www.oracle.com/technology/sample_code/tech/windows/odpnet/howto/connect/index.html

<- Note that this is the way to go. make sure that you do connection pooling to save money on performance consultant Smile

3. .NET data provider for Oracle – From .NET side. pretty much OLEDB stuff. Didn’t go good on performance front for Obvious reasons, last choice for me.