1、服务器端:
1)新建WebService;
2)添加MyUsernameTokenManager,MySoapHeader






































4)设置WES属性 General 页中两项全选
Security页中添加 SecurityTokensManagers
Type 修改如下 MyUsernameTokenManager(类名), App_Code(程序集名)
5) Policy页选中 Enable Policy,添加ServerSidePolicy:Secure a service application \ Username;PerformAuthorization 不选;EnableWS-Security1。1 Extensions, ProtectionOrder 选None(rely on transport protection);完成即可。
2、客户端:
1)新加客户端。
2)设置WSE 3。0:General页选中第一项;Policy页选中Enable Policy,添加EditApplicatioPolicy:ClientSidePolicy,Secure a client application ,username;SpecifyUsername Token in code;EnableWS-Sercurity1。1 Extensions ,ProtectionOrder:None;完成即可。
3)引用WebService。
4)








写的真乱,自己都看不懂

向 RicCC (虽然按照他的例子我也没做成功),向Teamleader学习。
谦虚使用进步。