Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to manage workflow service from ASP.NET using net.pipe binding
    primarykey
    data
    text
    <p>I'm trying to manage my workflow service that hosted on AppFabric through the standard named pipe endpoint. I successfully can do this from the console application, but when try to do the same from ASP.NET I get "Access is denied" exception.</p> <p>I understand that it's the security configuration problem that should be resolved somehow in web.config but I have no idea how... </p> <p>Here is the code that I use:</p> <pre><code>NetNamedPipeBinding binding = new NetNamedPipeBinding(); EndpointAddress addr = new EndpointAddress("net.pipe://localhost/ServiceLibrary/LongRunningService.xamlx/System.ServiceModel.Activities_IWorkflowInstanceManagement"); try { var proxy = new WorkflowControlClient(binding, addr); Guid instanceId = new Guid("&lt;&lt;SOME WORKFLOW INSTANCE ID&gt;&gt;"); proxy.Suspend(instanceId); } catch (Exception ex) { } </code></pre> <p><strong>UPDATE:</strong> in theory it possible to register endpoints (either http or net.pipe) in web.config with no security. In this case looks like everything is working... but I don't want to do this for every service registered on the site. I think there should be some way to connect to already registered net.pipe endpoint. Here is the web config with explicit endpoint registration (http, net.pipe):</p> <pre><code>&lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior&gt; &lt;remove name="serviceCredentials" /&gt; &lt;serviceMetadata httpGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt; &lt;sqlWorkflowInstanceStore instanceCompletionAction="DeleteNothing" instanceEncodingOption="None" instanceLockedExceptionAction="NoRetry" connectionStringName="ApplicationServerWorkflowInstanceStoreConnectionString" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:05" /&gt; &lt;workflowInstanceManagement authorizedWindowsGroup="" /&gt; &lt;workflowUnhandledException action="AbandonAndSuspend" /&gt; &lt;workflowIdle timeToPersist="00:00:30" timeToUnload="00:01:00" /&gt; &lt;etwTracking profileName="Troubleshooting Tracking Profile" /&gt; &lt;/behavior&gt; &lt;behavior name="StnandardBehavior"&gt; &lt;remove name="serviceCredentials" /&gt; &lt;serviceMetadata httpGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt; &lt;sqlWorkflowInstanceStore instanceCompletionAction="DeleteNothing" instanceEncodingOption="None" instanceLockedExceptionAction="NoRetry" connectionStringName="ApplicationServerWorkflowInstanceStoreConnectionString" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:05" /&gt; &lt;workflowInstanceManagement authorizedWindowsGroup="" /&gt; &lt;workflowUnhandledException action="AbandonAndSuspend" /&gt; &lt;workflowIdle timeToPersist="00:00:30" timeToUnload="00:01:00" /&gt; &lt;etwTracking profileName="Troubleshooting Tracking Profile" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="httpSecurityOff" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt; &lt;security mode="None"&gt; &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt; &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; &lt;netNamedPipeBinding&gt; &lt;binding name="pipeSecurityOff" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" maxConnections="10" maxReceivedMessageSize="65536"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;security mode="None"&gt; &lt;transport protectionLevel="None" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/netNamedPipeBinding&gt; &lt;/bindings&gt; &lt;services&gt; &lt;service name="LongRunningService" behaviorConfiguration="StnandardBehavior"&gt; &lt;endpoint address="wce" contract="System.ServiceModel.Activities.IWorkflowInstanceManagement" binding="basicHttpBinding" bindingConfiguration="httpSecurityOff" kind="workflowControlEndpoint" /&gt; &lt;endpoint address="wce" contract="System.ServiceModel.Activities.IWorkflowInstanceManagement" binding="netNamedPipeBinding" bindingConfiguration="pipeSecurityOff" kind="workflowControlEndpoint" /&gt; &lt;endpoint contract="ILongRunningService" binding="basicHttpBinding" bindingConfiguration="httpSecurityOff" /&gt; &lt;/service&gt; &lt;/services&gt; </code></pre> <p>and in this case client code for connection to this new endpoint should be a little be other:</p> <pre><code> NetNamedPipeBinding binding = new NetNamedPipeBinding(); binding.Security.Mode = NetNamedPipeSecurityMode.None; EndpointAddress addr = new EndpointAddress("net.pipe://{{MACHINE_NAME}}/ServiceLibrary/LongRunningService.xamlx/wce"); try { var proxy = new WorkflowControlClient(binding, addr); Guid instanceId = new Guid(workflowInstanceId.Value); proxy.Suspend(instanceId); proxy.Close(); } catch (Exception ex) { } </code></pre>
    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.
    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