【发布时间】:2013-06-23 19:38:08
【问题描述】:
我想连接到这个地址上的网络服务: https://webapp2.rzzo.rs/rzzo/RzzoService?wsdl 我在我的 .net 4.0 C# 应用程序中添加了对它的服务引用。 这是我用来连接到这个服务的代码:
ServiceReference1.RzzoServiceClient client = new ServiceReference1.RzzoServiceClient();
client.ClientCredentials.UserName.UserName = "------";
client.ClientCredentials.UserName.Password = "-------";
bool check = client.CheckConnection();
这是我必须得到的消息(我从我的服务提供商那里得到的):
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-
utility-1.0.xsd">
<s:Header>
<o:Security s:mustUnderstand="1"
xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-
secext-1.0.xsd">
<o:UsernameToken u:Id="uuid-cdf8690a-e56a-4efa-923c-760d22b6748d-7">
<o:Username>username</o:Username>
<o:Password>password</o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetInsuranceDataF xmlns="http://service.rzzo.rs/">
<req xmlns="">
<lbo/>
<zk>11111111111</zk>
</req>
</GetInsuranceDataF>
</s:Body>
</s:Envelope>
但我无法连接到服务。 请帮忙
【问题讨论】:
-
您遇到的错误是什么?
-
这里是错误:“用户名密码令牌的身份验证失败”..
标签: c# web-services wcf-security