Save password in WCF adapter binding file

Posted by Edmund Zhao on Geeks with Blogs See other posts from Geeks with Blogs or by Edmund Zhao
Published on Mon, 27 Jun 2011 20:06:51 GMT Indexed on 2011/06/28 8:23 UTC
Read the original article Hit count: 311

Filed under:

Binding file for WCF Adapter doesn't save the password no matter it is generated by "Add Generated Items..." wizard in Visual Studio or "Export Bindings..." in administration console. It is by design dut to the consideration of security, but it is very annoying especially when you import bindings which contain multiple WCF send ports. The way to aviod retyping password everytime after an import is to edit the binding file before import. Here is what needs to be done.

1. Find the following string:

    <Password vt="1" />

"&lt;" means "<", "&gt;" means ">", "vt" means "Variable Type", variable type 1 is "NULL", so the above string can be translated to "<Password/>"

2. Replace it with:

    &lt;Password vt="8"&gt;MyPassword&lt;/Password&gt;   

variable type 8 is "string", the above string can be transalted to "<Password>MyPassword</Password>"
 
Binding file uses a lot of character entity references for XML character encoding purpose. For a list of the special charactor entiy references, you can check from here.

...Edmund Zhao

© Geeks with Blogs or respective owner