Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

VS2005 Add Service Reference doesn't create correct proxy security config

Update your Vista Drivers Update Your Drivers Now!!
 
 
Thread Tools Display Modes
Old 11-12-2007   #1 (permalink)
eshneken
Guest


 

VS2005 Add Service Reference doesn't create correct proxy security config

Hello,

I am trying to create a WCF host/client combination using mixed
security with UserName authentication.

Everything looks good on the host side, but when I go to generate the
client proxy using the VS 2005 "Add Service Reference" wizard it
generates a proxy class that, while correct in all respects for my
service, doesn't seem to have any knowledge of security credentials.

I'm looking to be able to do something like:

proxy.ClientCredentials.UserName.UserName = "name";

but neither the proxy generate nor the additions to my app.config seem
to recognize the security choices I've made in the web.config of my
host.

The servicemodel portion of my web.config is below. Any ideas?

<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MyBehavior">
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceCredentials>
<userNameAuthentication
userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="MyValidator, App_code"/>
</serviceCredentials>
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>

<services>
<service behaviorConfiguration="MyBehavior"
name="MyInterface">
<endpoint binding="wsHttpBinding" name="wsHttpWithUsername"
contract="IMyInterface"/>
<endpoint address="mex" binding="mexHttpBinding"
name="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>

<bindings>
<wsHttpBinding>
<binding name="wsHttpWithUsername">
<security mode="TransportWithMessageCredential" >
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
</bindings>

</system.serviceModel>


Thanks in advance!
Ed


My System SpecsSystem Spec
Old 11-17-2007   #2 (permalink)
Tiago Halm
Guest


 

Re: VS2005 Add Service Reference doesn't create correct proxy security config

Update your endpoint definition with the bindingConfiguration attribute:

<endpoint
binding="wsHttpBinding"
name="wsHttpWithUsername"
bindingConfiguration="wsHttpWithUsername"
contract="IMyInterface"/>

Tiago Halm


My System SpecsSystem Spec
 

Thread Tools
Display Modes




Update your Vista Drivers Update Your Vista Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008