I am developing a wcf service . I have created two dll\'s one for message contracts and one for service contracts interfaces. I share these two dll\'s with server and client
Use an app.config like this (when you use "Add Service Reference" from Visual Studio, VS will typically create this for you automatically - and you just need to tweak it to your needs):
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="UserNameSecurity">
<security mode="Message">
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8888/MyService" binding="basicHttpBinding"
bindingConfiguration="UserNameSecurity" contract="IMyService" />
<endpoint address="net.tcp://localhost:8484/MyService/Mex"
binding="mexTcpBinding"
bindingConfiguration=""
contract="IMetadataExchange" name="mexNetTcp" />
</client>
</system.serviceModel>
</configuration>
The section and its possible values and subsection are well documented in the WCF configuration.
Alternatively, in VS 2008 SP1, you can use the "WCF Service Configuration Editor" - see it in "Tools > WCF Service Configuration Editor".
It allows you to visually define and modify your client config settings. Once you've launched it from the Tools menu, after that, you can acutally even right-click on the app.config in your Solution Explorer and launch it from there (using that app.config as its basis).
Marc