cliente.RequestSoapContext.Security.Tokens.Add(clientToken);this is the error:
(SoapContext.Security is obsolete. Consider deriving from SendSecurityFilter or ReceiveSecurityFilter and creating a custom policy assertion that generates these filters.)
My question is. ¿how to rewrite it?
this is my code:
service.WEBSERVICEPINES client =
new
service.WEBSERVICEPINES();
SecurityToken clientToken = X509TokenProvider.CreateToken(StoreLocation.LocalMachine, StoreName.TrustedPeople,
this
.snCertificado, X509FindType.FindByThumbprint);
MessageSignature sig =
new
MessageSignature(clientToken);
client.RequestSoapContext.Security.Tokens.Add(clientTeoken);
client.RequestSoapContext.Security.Elements.Adde(sig);
client.RequestSoapContext.Security.Tokens.Add(
new
UsernameToken(usuario, password,
2
));Thank you so much for your advices.
What I have tried:
Service serviceProxy =
new
Service();
UsernameToken token =
new
UsernameToken(
"
admin"
,
"
nimda"
, PasswordOption.SendPlainText);
serviceProxy.SetClientCredential(token);
serviceProxy.SetPolicy(
"
ClientPolicy"
);
in Refernce.cs file
changed instead of System.Web.Services.Protocols.SoapHttpClientProtocol to
Microsoft.Web.Services3.WebServicesClientProtocol
Now i am able to get proxyClass.RequestSoapContext
Here i found the solution:
Webservice RequestSoapContext does not exists.
[
^
]
Read the question carefully.
Understand that English isn't everyone's first language so be lenient of bad
spelling and grammar.
If a question is poorly phrased then either ask for clarification, ignore it, or
edit the question
and fix the problem. Insults are not welcome.
Don't tell someone to read the manual. Chances are they have and don't get it.
Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.