Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use a user defined binding on an IIS hosted wcf?
    primarykey
    data
    text
    <p>I'm creating a WCF web service to be hosted on IIS, and accessed via internet for a Java Client.</p> <p>I had to implement a Custom binding to acomplish some requirements, but I don't know how to setup the service via config to use this customized binding.</p> <p>How can I do this?</p> <p>If the first question is not possible, is there a way to translate this customized binding into a normal customBinding element defined in web.config</p> <pre><code>public class MyCustomBinding : Binding { public override BindingElementCollection CreateBindingElements() { BindingElementCollection be = new BindingElementCollection(); X509SecurityTokenParameters initiator = new X509SecurityTokenParameters(X509KeyIdentifierClauseType.IssuerSerial, SecurityTokenInclusionMode.AlwaysToRecipient); initiator.RequireDerivedKeys = false; X509SecurityTokenParameters recipient = new X509SecurityTokenParameters(X509KeyIdentifierClauseType.IssuerSerial, SecurityTokenInclusionMode.AlwaysToInitiator); recipient.RequireDerivedKeys = false; AsymmetricSecurityBindingElement element = new AsymmetricSecurityBindingElement(recipient, initiator); element.SetKeyDerivation(false); element.IncludeTimestamp = true; element.SecurityHeaderLayout = SecurityHeaderLayout.Strict; element.MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncrypt; element.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10 element.DefaultAlgorithmSuite = SecurityAlgorithmSuite.TripleDesRsa15; element.AllowSerializedSigningTokenOnReply = true; X509SecurityTokenParameters tokenParameters = new X509SecurityTokenParameters(); tokenParameters.InclusionMode = SecurityTokenInclusionMode.AlwaysToRecipient; tokenParameters.RequireDerivedKeys = false; element.EndpointSupportingTokenParameters.Signed.Add(tokenParameters); be.Add(element); be.Add(new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, Encoding.UTF8)); be.Add(new HttpTransportBindingElement()); return be; } } </code></pre> <p>So, as a summary here are my question:</p> <ol> <li>How to use an user defined binding in an IIS hosted service (via config or anything else)?</li> <li>Is there a way to translate my user defined binding to a customBinding configurated via config?</li> </ol> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload