locked
Consume SSL Enabled WCF service in custom workflow/plug-in in CRM 2013 RRS feed

  • Question

  • Is there any way to consume SSL enabled WCf service in plug in/custom workflow?

    I have tried,  it's working fine in "None" mode and got failed for "SandBox" mode. :(

    Here is the WCF service bindnigs,

    <binding name="BasicHttpBinding_IIntegration_ConfigurationCRM"
     closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="03:30:00"
     sendTimeout="03:30:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
     maxReceivedMessageSize="2147483647" transferMode="Buffered"
     messageEncoding="Text">
    <readerQuotas maxDepth="64" maxStringContentLength="2147483647"
     maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" />
    <security mode="Transport">
    <transport clientCredentialType="None"/>
    </security>
    </binding>

    <endpoint address="One" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IIntegration_ConfigurationCRM"
     name="BasicHttpBinding_IIntegration_EndpointCRM"
     contract="Microsoft.IT.WCFConnector">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>

    And Plug in code is,

    BasicHttpBinding basicHttpBinding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
                basicHttpBinding.Name = "BasicHttpBinding_IIntegration_ConfigurationCRM";
                basicHttpBinding.MessageEncoding = WSMessageEncoding.Text;
                basicHttpBinding.TextEncoding = System.Text.Encoding.UTF8;
                basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
                EndpointAddress endPointAddress = new EndpointAddress("https://server1:461/IService.svc");

    Error in Sandbox Mode: 

    Unhandled Exception: Microsoft.Crm.CrmException: Unexpected exception from plug-in (Execute):
     MSIT.CRM.ValidateMIOId: 
     System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, 
     Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
       at Microsoft.Crm.Sandbox.SandboxCodeUnit.Execute(IExecutionContext context)
       at Microsoft.Crm.Workflow.Services.ProxyCustomActivity.Execute(CodeActivityContext executionContext)

    Thanks in advance......

    Thursday, December 4, 2014 2:36 PM

All replies