468,270 Members | 1,544 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,270 developers. It's quick & easy.

Web Service Authentication problem

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
0 1301

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by cmueller | last post: by
4 posts views Thread by =?Utf-8?B?VGFrdW1p?= | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.