473,473 Members | 4,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VS2005 Add Service Reference not generating security proxy informa

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

Nov 12 '07 #1
2 2142
=?Utf-8?B?RWQgU2huZWtlbmRvcmY=?=
<Ed***********@discussions.microsoft.comwrote in
news:4A**********************************@microsof t.com:
<userNameAuthentication
userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="MyValidator, App_code"/>
This line looks a bit fishy... I think you didn't set your validator type
correctly.

I could be wrong ... Since I normally use a web application project.

When you set a breakpoint in your validation code - is it being hit?
Nov 13 '07 #2
Hi,

The problem is that I'm not even getting this far.... I've generated the
service host and I can see the WSDL when I browse to it. I then use the Add
Service Reference wizard in the client to generate a proxy class and the
proxy class is not generated with access to credentials.

I've seen samples where people set credentials like this:

ChannelFactory<IMDMSInterfacefactory =
new ChannelFactory<IMDMSInterface>("MyBinding");
factory.Credentials.UserName.UserName = "test1";
factory.Credentials.UserName.Password = "1tset";
IMyService service = factory.CreateChannel();

But I was thinking that I shouldn't have to do this and should be able to
access the Credentials object directly from the generated proxy class.

Any thoughts? Thanks,
Ed

"Spam Catcher" wrote:
=?Utf-8?B?RWQgU2huZWtlbmRvcmY=?=
<Ed***********@discussions.microsoft.comwrote in
news:4A**********************************@microsof t.com:
<userNameAuthentication
userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="MyValidator, App_code"/>

This line looks a bit fishy... I think you didn't set your validator type
correctly.

I could be wrong ... Since I normally use a web application project.

When you set a breakpoint in your validation code - is it being hit?
Nov 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bill Hauver | last post by:
I am attempting to use a web service from my work pc which is behind a firewall. I have used wsdl.exe to create the web service reference class and added it to my project. (this seems to work...
1
by: benthanger | last post by:
Hi there, I'm new to web services. I'm writing a basic file maintenance application in asp.net. For example I'll fill a grid with all the records from a table, then allow the user to select a...
4
by: Joe | last post by:
I'm hosting my web service on a Windows 2003 box which is remotely located. When trying to add a web reference to a C# project I get an error message 'There was an error downloading...
6
by: Eric Guthmann | last post by:
Hello all We have an SOA application that includes an ASP.NET webservice and WinForms client. My question is regarding the use of Add Web Reference in Visual Studio. The tool is nice because...
15
by: Joseph Geretz | last post by:
OK, I'll admit it up front - I just don't get it. Here's our previous VS2003 development model. Developers develop the WS solution on their own workstations, using their own IIS web servers...
2
by: rcp | last post by:
Hi all, I've read all posts from all existing threads and none of them worked to solve my problem, although its exactly the same. I'll try to explain my case and see if a kind soul could help me...
13
by: Edje.Rommel | last post by:
Hello, I've have a problem with a webservice. I just want to validate a VAT number by country code and VAT numer. The return value should be like "it's valid" and/or the name where it's...
2
by: Ravikanth | last post by:
I created a web application in vs2003 which cosumes a web services. I used SoapExtensions to log the Request sent to server and Response received from server by adding a SoapExtension attribute to...
3
by: Enda Manni | last post by:
Hi, I have a gSoap Web Service written using C++, it uses SOAP username and password authentication. I also have a C# form client consuming the web service, all this was working fine until...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.