Suneet Nangia Blogs & Beyond...
Suneet Nangia Blogs & Beyond...
Tags
Archives
Skip Navigation Links.
Feeds
RSS 2.0
About Me
I am a developer/designer who loves exploring new technologies.  
My Other Spaces
 
LinkedIn
Professional Profile

Flickr
Photography

Blogs I Visit
 
Stephen W. Thomas

Kevin B Smith
 
Saravan Kumar

John Flander

Biztalk Server Team

Darren Jefford

Daniel Moth
I have attended few of his workshops@ MS, Thames Valley. Very sharp fella with good programming knowledge.
Mike Taulty

Richard Grime

Chris Dickson
One line for him- Fantastic Biztalk & .Net Expert. I had a chance to work him, he is one person who will always do the right things rightly.
Mohit Nayyar
Exciting MS SQL/DB blog
Ben Cops
He is techincally very sound person with good balance between work and life.
Technical Readings
 
Inside WCF
Indepth WCF. If you want to extend WCF then this is the book you are looking for.  
CLR Via C#
Amazing book on core concepts of CLR and C#. Must have book.
Jeffrey has finished its 3rd edition as well which will soon be in the market. Follow this link for its release dates, availability etc
BLOGs-
All Months, All Years Showing Page 1 of 10
Mon, 30 Jan 2012 14:55:14 GMT
WSDL Error: Change the method's message name using WebMethodAttribute or change the type's root elem

Bumped into this error in the morning today while adding multiple methods to the WCF service contract with same input and output parameters.

Error-
Change the method's message name using WebMethodAttribute or change the type's root element using the XmlRootAttribute. Multiple methods with same parameters.

Cause-
If you have the similar WSDL generated then you will notice the part names are same for all messages. This is fine as long as element type is different but as soon as you have another method with same parameters then this is not the case as shown below and this cause the above error to occur-

 <wsdl:message name="IService_ReceiveRequest1_InputMessage">
    <wsdl:part name="parameters" element="cns:ClientRequest" />
  </wsdl:message>
  <wsdl:message name="IService_ReceiveRequest1_OutputMessage">
    <wsdl:part name="parameters" element="cns:ClientResponse" />
  </wsdl:message>

  <wsdl:message name="IService_ReceiveRequest2_InputMessage">
    <wsdl:part name="parameters" element="cns:ClientRequest" />
  </wsdl:message>
  <wsdl:message name="IService_ReceiveRequest2_OutputMessage">
    <wsdl:part name="parameters" element="cns:ClientResponse" />
  </wsdl:message>

Resolution-
In our project we use WSDL exporter component (IWsdlExporter) for a different reason but having that in place made it easy for me to change the part names to be unique and that resolved the issue. You may be able to resolve it using certain attributes as well.


Comments(0) | Permalink | Windows Communication Foundation

Wed, 04 Jan 2012 14:15:48 GMT
SSL Passthrough With TranspoprtWithMessageCredential security mode.

After spending hours on looking at options on internet and solution provided by Pedro Felix here I have cracked it using a new feature available in .net 4.0 and 3.5 SP1. Pedro's solution is great but it was deviced when 3.5 SP1 was not available to hand and therefore not the best option today.

Problem: Many organisations use hardware accelerated NLB for SSL encryption and decryption. This alleviates SSL processing load from actual web servers and also makes it easier to update the SSL certificate as there is only place to update the certificate. The problem is if you want to use Username/Password as a credential over secure transport (SSL) you need to chose security mode as "TranspoprtWithMessageCredential" in binding (WSHttpBinding). As soon as you do this WCF will ensure message received in IIS is encrypted with SSL. Now as SSL encryption/decryption is performed by NLB here WCF throws the error.

Solution: .Net 3.5 SP1 and 4.0 comes with a new properties allowInsecureTransport and enableUnsecuredResponse on SecurityBindingElement. Setting these properties to True allows WCF to ignore the strict rule of checking if message is SSL encrypted. This property is however not exposed by built in WSHttpBinding. To make use of it you will need to create a custom binding which set these properties correctly and also allow username/password in SOAP header using standard WS security protocols. Following custom binding works like "TranspoprtWithMessageCredential" mode but without HTTPS.

Server binding and endpoint config-

<bindings>
<
customBinding
>
<
binding name="customHttpBinding"
>
<
security authenticationMode="UserNameOverTransport" allowInsecureTransport="true" enableUnsecuredResponse="true"
/>
<
httpTransport
/>
</
binding
>
</
customBinding
>
</
bindings
>

<endpoint address="" binding="customBinding" bindingConfiguration="customHttpBinding" name="processMessage" bindingName="customHttpBinding" contract="SecurityCheckService.IService1"

Client binding and endpoint config-

<bindings>
<
customBinding
>
<
binding name="customHttpBinding"
>
<security authenticationMode="UserNameOverTransport" allowInsecureTransport="true" enableUnsecuredResponse="true"
/>
<
httpTransport
/>
</
binding
>
</
customBinding
>
</
bindings>

<client>
<
endpoint address=http://NLB_IP_OR_DNS/SecurityCheckService/Service1.svc binding="customBinding" bindingConfiguration="customHttpBinding" contract="ServiceReference1.IService1" name="processMessage"
behaviorConfiguration="via"/>
</
client
>

<behaviors>
<
endpointBehaviors>
<
behavior name="via">
<
clientVia viaUri="https://NLB_IP_OR_DNS/SecurityCheckService/Service1.svc"/>
</
behavior>
</
endpointBehaviors>
</
behaviors>


Note ClientVia behavior. This is required as service on IIS does not know about SSL. SSL is stripped off by NLB. This client config will ensure that the request is sent to Https address but "To" Soap Header block contains Http based address so that you do not get Address Filter mismatch error.

I use custom authenticator/validator to validate the credentials coming  into the SOAP header. Idea is to store credentials in SSO and validate them against the hash of the password. It's easy to create a custom validator which is explained here



Comments(3) | Permalink | Windows Communication Foundation

Thu, 22 Dec 2011 12:14:51 GMT
AppFabric Cache Configuration and Topologies

I ve been recently working on AppFabric cache design and implementation. When it comes to configuration storage in AppFabric Cache there are quite a lot of options available at hand.

Find here the Pdf containing all the options and their pros and cons to some extent. Please note I ve considered 6 cache nodes across the sites (primary and secondary).

Here is the link


Comments(0) | Permalink | AppFabric

Wed, 20 Jul 2011 16:22:16 GMT
Logical vs User Connections SQL Server 2005 onwards

SQL Server gives two performance counters around connections it is servicing.
Very quickly, Logical connections are the ones which are made over the same physical (user) connection by the client and can service multiple result sets at the same time.
If you enable Multiple Active Result Sets (MARS) on your client connection string, .Net will use up to 10 logical connections on a single physical connection. Hence, on SQL you will se 1 user connection and more than 1 (up to 10) logical connections.


Comments(0) | Permalink | ORM
Showing Page 1 of 10