ASP.NET News from Blogger:
hongmeigs WebLog
Total News: 47
There is a cool WCF feature instroduced in dev10 called configless activation. You don't have to have a *.svc file in your web directory, instead you can activate a WCF service using the following con...
The default value of MaxReceiveMessageSize in WCF is 65,536. When you choose streaming as TransferMode, WCF runtime will create 8192 as buffer size. So what happened now is that WCF channel...
There are a lot of timeouts in WCF. let us summarize it here.
Timeouts on binding
These are the most well known timeouts. SendTimeout, ReceiveTimeout, OpenTimeout and CloseTimeo...
You are getting this error because the default WCF stream formatter does not support this. You are probably trying to upload some file stream and transfer some other parameters, such as file nam...
Missing a trailing slash is a common error people make when browsing the web. For better usability, in 4.0, we introduced a feature called autoredirect. It is on by default, meaning, when you set up y...
If you happen to get the following sql error:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005 or above, this failure may be ca...
If you are getting an error like : Cannot resolve KeyInfo for unwrapping key: KeyInfo 'SecurityKeyIdentifier and your have checked that your certificate is in the right store and right place.
So this...
There are two options:
1. OperationContext.Current.
Pros: This is pretty straightforward and relatively hard to discover.
Cons: This is a thread local storage, and you are invoking a ...
If you are getting the following error:
Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances What should I do?
Answer: To fi...
By default findstr does the comparison with regular expression. However, what surprised me is that the following command does not work.
findstr "abc|def" test.txt
when test...
First let me explain why it does not work.
There are three string comparisons done by card space. The information card has Issuer, IssuerEndpointAddress, and IssuerMexAddress.
When you...
There are three steps you need to take to make it work.
1. Modify your hosts file under \Windows\System32\drivers\etc\hosts and add the following entry:
127.0.0.1 mydomain...
In IIS 6, you can start the IIS manager by typing the inetmgr at the Start->Run windows, and click on the web site, Right click on the web site, go to the directory security, you will have windows ...
The common error that users will run into for the personal card scenario is that the WCF service cannot verify the signing credentials of the saml token. This is because the personal card will trigger...
One possibility is that your binding does not contains required claim types. In your client binding, make sure you have at least one required claims:
WSFederationHttpBinding binding = new WSFederation...
You need to make sure that your personal card contains the required claim types you specified in your client binding. To fix this, try set the required claim types to one of the claims that your perso...
First you need to download some windows sdk tools. You can get those from http://www.microsoft.com/downloads/details.aspx?FamilyId=C2B1E300-F358-4523-B479-F53D234CDCCF&displaylang=en. Only check t...
If you are using Https, this might fix it.
ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCallb...
What could go wrong when cardspace UI is not popping up? You can see if you have card space UI working properly on your box by go to Control Panel->Windows CardSpace. The correct behavior is t...
This is a forum question, and here is a very sneaky way to do so.
protected override bool CheckAccessCore(OperationContext operationContext)
{
string msgStr = operationContext.Reque...
IIS 7 has a new UI which is different from the previous version. Here I am going to talk about how to set up the SSL via the new UI.
It is a different user experience for setting up the ssl certificat...
Yes, i am sure quite a lot of people have already seen the great card space UI. But if you are like me who wants to understand the message flow and what is in the card, here are the answers.
First,&nb...
A clean installation of Vista, download the card space sample from http://cardspace.netfx3.com, and download the Simple WPF based smartclient application, run the install.bat for setup, i got the foll...
"Simple WPF based Smartclient application" sample from http://cardspace.netfx3.com/files/default.aspx is an excellent sample to learn how self issued info card are being used. The caching behav...
I want to serialize something similar to this format:
<Body>
<Response>
&...
Getting identity verifier error? Here is one way to work around it.
securityBindingElement.LocalClientSettings.IdentityVerifier = new CustomVerifier();
And Here is an example of how this c...
For presentation, start VS, go to Tools->Options, under Environment/Fonts and colors, choose Lucida Console, and font size 14.
Choose Courier New, and font size 10 for writing code.
 ...
Distributing x.509 is always a painful thing, and using WCF, it no long is.
In the WCF configuration, there is a knob in the configuration which helps the client to get the public key portion of the c...
If you are going to request one certificate from a cert authority, then you probably need to explicitly ask for the following key usages:
Digital Signature, Key Encipherment and Data Encipherment.
Use...
Wondering how do you ever get intellisense while writing configuration files using VS?
Here is why? All the scchemas for VS are defined at {...}\VisualStudio\bin\i386\xml\schemas\dotNetConfi...
If you are getting 403.1 error while hosting WCF using IIS, then you might be using the wrong directory name.
Let us say you want to host your service at
http://localhost/A/service.svc
And the ...
Your IIS needs to link the .svc extension to the aspnet_isapi.dll. You can this by right click on your v-root from IIS manager. on the virtual directory tab, click on the Configuration button, and you...
Make sure that you don't have any reference in your code which still refer to the WSE 2 dll. VS 2005 will auto add the assembly reference when you build the web site project....
If you are running into some perf issue with using X509 certificate in WSE 3.0 or .NET Framework 2.0, here might be the reason.
There is a known perf issue to do X509Certificate2.Extensions OID&n...
I have been working on the performance these days, and I want to share some tricks that you can do to reduce memory allocation significantly if the xml document you are working with is huge.
Use XmlEl...
I have tested it against Everrette. If an xmlelement you are working with doesn't contain any attributes, calling XmlElement.Attributes will trigger the system to create an empty ArrayList. The best w...
This release fixes some top customer issues and provide a new security token, KerberosToken2, which supports impersonation, windows constrained delegation. The new token also works wel...
This should be quite easy. After installing the right version of Whidbey, go to your framework directory, and run aspnet_regiis.exe under the whidbey directory. >cd \WINDOWS\Microso...
This is a very sneaky feature which has been discovered or blogged by quite a few .net gurus. I just want to give a simple example as how to declare it properly. Let us say you are develop...
When you use X509Certificate to encrypt a message, sometime you will see an error like "Private Key is not available". Here is the list you want to check first: 1. Permission problem...
As promised, i would talk about a second approach to achieve symmetric key based encryption in WSE 2.0. First, you need to create a simple hello world web service with a client project and a web ...
In WSE 1.0, symmetric key encryption could be done through decryption key provider. Moving to WSE 2.0, every security operation has been bound with a security token, including the symmetric key ...
The idea of SecurityTokenManager is very powerful. It provides one single place to extend the WSE built-in token infrastructure. You can only have one t...
Yes, believe your eyes. Marshal.SizeOf(typeof(char)) = 1, however sizeof(char) = 2. Reason Not sure about the first one, i guess it is traditional C style while char used to be defin...
In case you don't know, WSE 2.0 SP1 has already shipped. You can download it from http://www.microsoft.com/downloads/details.aspxFamilyId=FC5F06C5-821F-41D3-A4FE-6C7B56423841&displaylang=en ...
Yes! The second version of Web Service Enhancements for Microsoft .NET has recently shipped!
There are a lot of excitement and enthusiasms about WSE 2.0 RTM. The release wa...
Currently, I am a developer in Adanced Web Services team. The product I am working on is called Web Services Enhancements, commonly known as WSE. It is my first te...
View Other bloggers