我是使用.net 4.0 VS2010的新手。我需要使用java web服务并发送usernametoken自定义身份验证来访问服务,这是我很容易在VS2005中使用WSE2.0,那么在net 4.0中替换它是什么?
我的客户端是.net 4.0 Asp.net Web应用程序(网站),服务是java webservice。
谢谢
在与谷歌叔叔核对之后,好吧,以下网站是一个起点
WCF Security
基于此,我对代码做了一些修改,但仍然没有太多的喜悦。继承人的代码
protected void TPLoginButton_Click(object sender, EventArgs e)
{
thirdpartyloginClient tplogin = null;
ThirdPartyLogInResponse proxyresponse = null;
ThirdPartyLogInRequest proxyrequest = null;
try
{
if (tplogin == null)
{
tplogin = new thirdpartyloginClient();
}
if (proxyrequest == null)
{
proxyrequest = new ThirdPartyLogInRequest();
}
tplogin.ChannelFactory.Credentials.UserName.UserName = "abcd";
tplogin.ChannelFactory.Credentials.UserName.Password = "sWwqHyCKMgjttlJEsQIvxzuBPTIBeVquZRPZqZdbDYDaOiHVxKuwYuYmQDVtqqBrBAlLiuOwWwQwOfTqSzOpyUaEbliOPaBHJTnBvulRSuZrcTHddKXwAIIxYDcuUmBJ";
proxyrequest.username = "gauls";
proxyresponse = tplogin.ThirdPartyLogIn(proxyrequest);
}
catch
{
if (proxyresponse != null)
{
ResultBoxResponse.Text = proxyresponse.result.resultMessage.ToString();
}
else
{
ResultBoxResponse.Text = "Empty response!!";
}
}
finally
{
if (proxyresponse != null)
{
ResultBoxResponse.Text = proxyresponse.result.resultMessage.ToString();
}
else
{
ResultBoxResponse.Text = "Empty response!!";
}
}
}我的web.config如下所示
问题是
我如何添加时间戳和密码作为密码摘要
我现在得到的错误是
提供的URI方案'http'无效;预计'https'。
参数名称:via
我尝试使用clearusernamebinding
我收到以下错误
从另一方收到一个无担保或错误安全的故障。查看故障代码和细节的内部FaultException。
我的web.config文件看起来像这样
<
system.serviceModel>
<
client>
<
endpoint address=http://10.2.2.16:7070/demo/ws/thirdpartylogin
binding="clearUsernameBinding" bindingConfiguration="myClearUsernameBinding"
contract="ThirdPartyLoginService.thirdpartylogin"
name="ClearUsernameBinding_thirdpartylogin" />
client>
<
extensions>
<
bindingExtensions>
<
add name="clearUsernameBinding" type="WebServices20.BindingExtenions.ClearUsernameCollectionElement, ClearUsernameBinding" />
bindingExtensions>
extensions>
system.serviceModel>“接收方对消化密码的要求尚未得到满足”的强烈文字说明了实际的错误
我如何在PasswordDigest头部发送密码?