By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,173 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,173 IT Pros & Developers. It's quick & easy.

Web Service Authentication problem

P: n/a
What I'm doing wrong that I can't make my authentication to work.
Here is the situation: I'm hosting a Web Service from a Windows forms
application, using .NET Framework 3.0 WCF. And I want to implement user
authentication.
Here is my Web Service class called "methods":

public class Authentication : SoapHeader
{
public String user;
public String pwd;
}

[ServiceContract]
public class methods
{
public Authentication authentication;

[OperationContract]
[SoapHeader("authentication", Direction =
SoapHeaderDirection.In)]
String Authentikacija()
{
if (authentication == null)
{
return "no authentication found";
}
else
{
string user = authentication.user;
string pswd = authentication.pwd;

return "user: " + user + " pwd: " + pswd;
}
}

My Client program uses .NET Framework 2.0, here is short
implementation:

public class Authentication : SoapHeader
{
public String user;
public String pwd;
}

WebProxy = new WebProxy();
Authentication authentication = new Authentication();

authentication.user = textBox2.Text;
authentication.pwd = textBox3.Text;
textBox1.Text = WebProxy.Authentikacija();

I can not get any login information to be sent over SOAP header. Is
there a mistake in my implementation? When I call WS method I get
return value "no authentication found".

Thank You

Oct 13 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.