java webservice用户验证_使用java webservice的.net4.0 web app需要Usernametoken身份验证
我是使用.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頭部發送密碼?
總結
以上是生活随笔為你收集整理的java webservice用户验证_使用java webservice的.net4.0 web app需要Usernametoken身份验证的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《饥饿游戏》前传女主演敲定:“白雪公主”
- 下一篇: 封装出现 用户.计算机,ES4封装WIN