解决方案 »
- 关于developer express 的 RepositoryItemCheckEdit 多选
- 关于BufferedStream的问题
- myCommand.Fill()方法如何填充多个表` --小弟没分了请各位包含 指教指教把``
- 如何保存剪贴板中的数据(任意格式)并读取出来?
- 如何在同页面中的Repeater控件中获取DropDown已经选定的值
- C#超级难题,高手占出来,能解决的都是神!
- ★★★关于ComboBox的默认选项功能★★★
- 求助c#与SQLSERVER存取问题
- 输入网址进行链接
- c# m2mqtt 无法从服务器读取数据
- C#2010做航空机票预订管理系统登录界面有问题
- 新手诚心求教C#
基于WCF的WF代码:
<WorkflowService mc:Ignorable="sap" ConfigurationName="Service1" sap:VirtualizedContainerService.HintSize="309,382" Name="Service1" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel" xmlns:mc="http://schemas.openxmlformats.org/up-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:p="http://tempuri.org/" xmlns:p1="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<p1:Sequence DisplayName="Sequential Service" sad:XamlDebuggerXmlReader.FileName="D:\源代码\WFMemoryTest\WfServer\WfServer\Service1.xamlx" sap:VirtualizedContainerService.HintSize="279,352" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
<p1:Sequence.Variables>
<p1:Variable x:TypeArguments="CorrelationHandle" Name="handle" />
<p1:Variable x:TypeArguments="x:Int32" Name="data" />
</p1:Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg3:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg3:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Receive x:Name="__ReferenceID0" CanCreateInstance="True" DisplayName="ReceiveRequest" sap:VirtualizedContainerService.HintSize="257,94" OperationName="GetData" ServiceContractName="p:IService">
<Receive.CorrelationInitializers>
<RequestReplyCorrelationInitializer CorrelationHandle="[handle]" />
</Receive.CorrelationInitializers>
</Receive>
<SendReply Request="{x:Reference __ReferenceID0}" DisplayName="SendResponse" sap:VirtualizedContainerService.HintSize="257,94">
<SendParametersContent>
<p1:InArgument x:TypeArguments="x:String" x:Key="result">true</p1:InArgument>
</SendParametersContent>
</SendReply>
</p1:Sequence>
</WorkflowService>
Web.config配置:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="false"/>
<sqlWorkflowInstanceStore connectionString="Server=devdb.dev.sh.ctriptravel.com,28747;Trusted_Connection=yes; Initial Catalog=CTITaskManageDB"/> <!--<sqlWorkflowInstanceStore connectionString="××××××××××"/>--> <!--Set the TimeToUnload to 0 to force the WF to be unloaded. To have a durable delay, the WF needs to be unloaded otherwise it will be thread as an in-memory delay--> <workflowIdle timeToUnload="0"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>
客户端调用:
ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();
for (int i = 0; i <= 100; i++)
{
string result = client.GetData();
}
基于WCF的WF代码:
<WorkflowService mc:Ignorable="sap" ConfigurationName="Service1" sap:VirtualizedContainerService.HintSize="309,382" Name="Service1" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel" xmlns:mc="http://schemas.openxmlformats.org/up-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:p="http://tempuri.org/" xmlns:p1="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<p1:Sequence DisplayName="Sequential Service" sad:XamlDebuggerXmlReader.FileName="D:\源代码\WFMemoryTest\WfServer\WfServer\Service1.xamlx" sap:VirtualizedContainerService.HintSize="279,352" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
<p1:Sequence.Variables>
<p1:Variable x:TypeArguments="CorrelationHandle" Name="handle" />
<p1:Variable x:TypeArguments="x:Int32" Name="data" />
</p1:Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg3:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg3:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Receive x:Name="__ReferenceID0" CanCreateInstance="True" DisplayName="ReceiveRequest" sap:VirtualizedContainerService.HintSize="257,94" OperationName="GetData" ServiceContractName="p:IService">
<Receive.CorrelationInitializers>
<RequestReplyCorrelationInitializer CorrelationHandle="[handle]" />
</Receive.CorrelationInitializers>
</Receive>
<SendReply Request="{x:Reference __ReferenceID0}" DisplayName="SendResponse" sap:VirtualizedContainerService.HintSize="257,94">
<SendParametersContent>
<p1:InArgument x:TypeArguments="x:String" x:Key="result">true</p1:InArgument>
</SendParametersContent>
</SendReply>
</p1:Sequence>
</WorkflowService>
Web.config配置:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="false"/>
<sqlWorkflowInstanceStore connectionString="Server=devdb.dev.sh.ctriptravel.com,28747;Trusted_Connection=yes; Initial Catalog=CTITaskManageDB"/> <!--<sqlWorkflowInstanceStore connectionString="××××××××××"/>--> <!--Set the TimeToUnload to 0 to force the WF to be unloaded. To have a durable delay, the WF needs to be unloaded otherwise it will be thread as an in-memory delay--> <workflowIdle timeToUnload="0"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>
客户端调用:
ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();
for (int i = 0; i <= 100; i++)
{
string result = client.GetData();
}