Задайте вопросЗадайте вопрос
 

ОтвеченоWCF Dynamic Proxy (Microsoft)

Ответы

  • 22 августа 2007 г. 14:28Allan-Nielsen Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено

    hi,

    are you running into this error here :

     - The remote certificate is invalid according to the validation procedure.

     

    a quick solution (no not dirty ) would be to skip validation by using code like this:

     

    Code Snippet

    ServicePointManager.ServerCertificateValidationCallback +=
                    new System.Net.Security.RemoteCertificateValidationCallback(ReturnTrueInThisCallBackFunctionHere);

     

     

    hth, Allan

  • 23 августа 2007 г. 14:58Allan-Nielsen Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено

    hi,

    assuming clientCredentialType = "Certificate".

     

    you will have to set the client certificate on the dynamicproxy.

     

    now the proxy does not have support for this, but you can extend the proxy beyond recognition of course .

     

    start by creating a public method on the DynamicProxy (derived from  DynamicObject)

     

    Code Snippet

    public ClientCredentials Credentials
    {
         get
         {
           return (ClientCredentials)base.GetProperty("ClientCredentials");
         }

    }

     

     

     

    from your client code you can now set the certificate on the proxy.

     

    Read more on this subject here

    http://msdn2.microsoft.com/en-us/library/ms733102.aspx

     

    I am not sure if this subject here is more a DynamicProxy thing than a WCF in general related question, if so the wcf list moderator can stop this thread....

     

    but for now you should be armed with all you need to continue your work with this dynamic proxy.

     

    hth, Allan

     

Все ответы