标签: workflowservice

Generic InArgument throws an exception trying to get the value

I have an Activity where I declared a InArgument without a type (because I want to know the type of the Expression at design time).

When I execute the activity I get this error in var contentTelegram line:

"The argument of type '<type>' cannot be used.  Make sure that it is declared on an activity."
Run Code Online (Sandbox Code Playgroud)

Here is my code:

public InArgument Content { get; set; }


protected override PlcMessage Execute(CodeActivityContext context)
        {

            try
            {
                var contentTelegram = Content.Get(context); 

               return new …
Run Code Online (Sandbox Code Playgroud)

workflowservice workflow-foundation-4 c#-4.0

5
推荐指数
1
解决办法
816
查看次数

如何修复“System.ServiceModel.Channels.ReceivedFault”无法序列化

我有一个工作流服务。我还在该服务中使用了工作流持久性。但是在 IIS 中部署工作流后,我从客户端向服务器上的日志文件中的工作流服务发出请求。我看到一条消息

The execution of the InstancePersistenceCommand named {urn:schemas-microsoft-com:System.Activities.Persistence/command}SaveWorkflow was interrupted by an error.InnerException Message: Type 'System.ServiceModel.Channels.ReceivedFault' cannot be serialized.
Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.
If the type is a collection, consider marking it with the CollectionDataContractAttribute.  See the Microsoft .NET Framework documentation for other supported types.
Run Code Online (Sandbox Code Playgroud)

我尝试了有关此异常的研究,但没有发现任何内容。

如何解决这个问题?或者让我知道上述异常的原因是什么?

wcf workflow workflowservice workflow-foundation-4

5
推荐指数
1
解决办法
1755
查看次数

为工作流服务提供工作流扩展 - WF 4.0

问候一个人!

我是WF 4.0和WWF的新手,所以请原谅我,如果这似乎是一个新手类型的问题,但相信我,我已经深入研究了这个问题的解决方案,但无济于事.

我创建了一个带有自定义CodeActivity的示例WF应用程序,需要提供扩展,如下所示:

public sealed class PreparePizza : CodeActivity
{
    public InArgument<Order> Order { get; set; }

    protected override void CacheMetadata(CodeActivityMetadata metadata)
    {
        base.CacheMetadata(metadata);

        if (this.Order == null)
            metadata.AddValidationError("You must supply an Order.");

        metadata.RequireExtension<IPreparePizzaExtension>();
    }
    // If your activity returns a value, derive from CodeActivity<TResult>
    // and return the value from the Execute method.
    protected override void Execute(CodeActivityContext context)
    {
        // Obtain the runtime value of the Text input argument
        Order order = context.GetValue(this.Order);
        var extension = context.GetExtension<IPreparePizzaExtension>();
        extension.Prepare(order); …
Run Code Online (Sandbox Code Playgroud)

wcf workflowservice workflow-foundation

2
推荐指数
1
解决办法
3313
查看次数

工作流服务在464条消息后停止响应

我在执行工作流程时遇到了一个特殊问题.
我已经尝试了我能想到的一切,现在需要一些想法.

这是我的配置:
1.在IIS 7中托管的WF4工作流服务(xamlx),并使用net.msmq/netMsmqBinding进行传输(MSMQ是事务性的).
2.没有使用工作流持久性.
3.我使用控制台应用程序客户端向工作流发送消息(每条消息创建新的工作流).4.每个工作流程如下:等待START消息 - >等待END消息(我只发送START消息).

如果我发送500条消息 - 464正确处理,但超过该消息,所有消息都转到lock_*队列,然后移动到毒性队列.我检查过Debug,Analytic事件日志,以及消息和跟踪svclogs这是我得到的最详细的消息:

System.TimeoutException,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089操作未在分配的超时00:00:30内完成.分配给此操作的时间可能是较长超时的一部分.at System.Runtime.AsyncResult.End [TAsyncResult](IAsyncResult结果)System.ServiceModel.Activities.Dispatcher.PersistenceProviderDirectory.LoadOrCreateAsyncResult.HandleReserveThrottle(IAsyncResult result)at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)System.TimeoutException:The操作未在指定的超时00:00:30内完成.分配给此操作的时间可能是较长超时的一部分.at System.Runtime.AsyncResult.End [TAsyncResult](IAsyncResult结果)位于System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult结果)的System.ServiceModel.Activities.Dispatcher.PersistenceProviderDirectory.LoadOrCreateAsyncResult.HandleReserveThrottle(IAsyncResult result)

那时请求http://localhost/MyWebService?wsdl也失败了404.

如果我重新启动IIS - 一切都恢复正常,直到发送464条消息.

  1. 我在哪里可以找到更详细的日志?(我已将System.Diagnostics设置为max verbosity)
  2. 是464号魔法吗?
  3. 导致此Web服务锁定的原因是什么?

msmq workflowservice workflow-foundation-4

2
推荐指数
1
解决办法
1354
查看次数

用于Workflow WCF服务(XAMLX)的服务名称

我试图弄清楚如何为我创建的WF服务(MyFoo.xamlx)提供端点等.通常,当您创建服务时,您需要使用服务名称=""来反映您创建的服务类型?即通过填写这样的东西:

<Service name="MyNameSpace.Foo" behaviorConfiguration="myFooBehaviorConfig">

这适用于典型的.svc场景,我可以正常工作.只有将这个概念映射到.xamlx服务?在那里,如果我有Foo.xamlx放在服务名称内部不起作用 - 或似乎不起作用(因为没有启用元数据).

如果我然后从服务中删除了behaviorConfiguration属性,并从 标记中删除了myFooBehaviorConfig<behavior/> - 因为它基本上会为web配置带来更多的全局设置 - 繁荣!我可以看到.xamlx暴露的方法/操作?

<serviceBehaviors> <behavior name="foo" > VS <serviceBehaviors> <behavior >

起初这很好,不需要任何努力,但同时我不希望开发人员访问HTTP端点或netpipe.我只希望他们通过我指定的net.tcp端口进入.为了做到这一点,我需要以<Service name=""/>某种方式匹配xamlx?

我也尝试过使用创建一个空的.svc文件然后以那种方式指向xamlx的技巧(这样开发人员总是假定它的.svc而不是.xamlx)

<%@ ServiceHost Language="C#" Debug="true" Service="ActivityHubService.xamlx" Factory="System.ServiceModel.Activities.Activation.WorkflowServiceHostFactory" %>

再次,如果我删除命名行为等,这也可以通过foo.svc ..但我似乎无法破解<service> 与freakin xamlx 的整个匹配!:) 呵呵.

令人沮丧..

这个领域的专家是谁?

wcf web-config workflowservice endpoint workflow-foundation-4

1
推荐指数
1
解决办法
2105
查看次数