Consuming a web service seems pretty straight forward in .net, you create the proxy and then use in code. The web service I am trying to hit has token security, so straight out of MSDN documentation I created the following method:
public void SecureMessage(SoapEnvelope envelope, Security security)
{
X509SecurityToken signatureToken = GetSecurityToken("CN=WSE2QuickStartClient");
if (signatureToken == null)
{
throw new SecurityFault("Message Requirements could not be satisfied.");
}
// Add the security token.
security.Tokens.Add(signatureToken);
// Specify the security token to sign the message with.
MessageSignature sig = new MessageSignature(signatureToken);
security.Elements.Add(sig);
}
My question is, how can I use this method and call the web service? Has anyone done this before? I wouldn't think it that difficult, but must admit I am stumped here.