工作流 WCF 服务 (XAMLX) 使用什么服务名称
我试图弄清楚如何向我创建的 WF 服务(MyFoo.xamlx)提供端点等。通常,当您创建服务时,您需要让服务名称=“”反映您创建的服务类型?即通过填写如下内容:
这适用于典型的 .svc 场景,我可以正常工作。只是如何将这一概念映射到 .xamlx 服务?如果我有 Foo.xamlx 将其放入服务名称中不起作用 - 或者似乎不起作用(因为没有启用元数据)。
如果我随后从服务中删除 behaviorConfiguration 属性,并从
中删除 myFooBehaviorConfig > 标签 - 因为它本质上为网络配置提供了更多的全局设置 - 繁荣!我可以看到 .xamlx 公开的方法/操作吗?
<服务行为> <行为名称=“foo”>
与 <代码> <服务行为> <行为> 起初这
很棒,不需要任何努力,但同时我不希望开发人员访问 HTTP 端点或 netpipe。我只希望它们通过我指定的 net.tcp 端口进入。为了做到这一点,我需要以某种方式将
与 xamlx 匹配?
我还尝试使用创建空 .svc 文件然后以这种方式指向 xamlx 的技巧(以便开发人员始终假设它是 .svc 而不是 .xamlx)
<%@ ServiceHost Language= "C#" Debug="true" Service="ActivityHubService.xamlx" Factory="System.ServiceModel.Activities.Activation.WorkflowServiceHostFactory" %>
同样,如果我删除命名行为等,这也可以通过 foo 起作用。 svc ..但我似乎无法破解
与一个怪异的 xamlx 的整个匹配! :) 呵呵。
令人沮丧..
有人是这个领域的专家吗?
I am trying to figure out how to provide endpoints etc to a WF Service that I created (MyFoo.xamlx). Typically when you create a Service you need to have the Service name="" reflect the type of service you've created? ie by filling out something like this:
<Service name="MyNameSpace.Foo" behaviorConfiguration="myFooBehaviorConfig">
This works in a typical .svc scenario and I can get that working fine. Only how does one map this concept across to a .xamlx service? In that if I have Foo.xamlx putting that inside the Service name doesn't work - or doesn't appear to work (as in no metadata is enabled).
If i then remove the behaviorConfiguration attribute from the Service and also remove the myFooBehaviorConfig from the <behavior/>
tag - in that it essentially then takes on more of a global setting for the web config - boom! I can see the .xamlx exposed methods/operations?
<serviceBehaviors>
<behavior name="foo" >
vs
<serviceBehaviors>
<behavior >
At first this is great, no effort required but at the same time I don't want devs to access HTTP endpoints or netpipe for that matter. I only want them to come in through net.tcp port I specify. In order to do that I need to match the <Service name=""/>
to the xamlx somehow?
I've also tried using the trick of creating an empty .svc file and then pointing to the xamlx that way (so that the devs always assume its a .svc and not a .xamlx)
<%@ ServiceHost Language="C#" Debug="true" Service="ActivityHubService.xamlx" Factory="System.ServiceModel.Activities.Activation.WorkflowServiceHostFactory" %>
Again, if I remove naming the behavior etc this also works via foo.svc ..but i just can't seem to crack the whole matching a <service>
with a freakin xamlx!! :) hehe.
Frustrating..
Anyone an expert in this space?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我要把这个交给 GuerreroTook,因为虽然他给出的答案部分位于右侧的同一区域,但它确实引发了“是的,也许就是这么简单……”的思考……
解决方案是这样的:
然后在一个我称之为 PingService.svc 的服务我这样说:
这似乎已经成功了! :)
不知道为什么,但我发誓我做了 3 次,但失败了..但是...我也需要睡眠..
希望这能帮助处于同一困境的其他人沿着轨道走下去。
I'm gonna give this one to GuerreroTook as although the answer he gave was partially in the same area of right it did however spark a moment of "yeah maybe its that simple.." thinking..
The solution was this:
Then inside a service i called PingService.svc I put this:
That seemed to have done the trick!! :)
Not sure why but i swore I did this like 3x and it failed..but...i am also in need of sleep..
Hopefully this will help others in the same jam down the track.
根据您的要求,我了解到您需要将 WF 工作流公开为 WCF 服务,并且希望客户端通过 WCF 基础设施直接调用 WF,对吗?
您面临的问题是您需要提供类的完整限定名称,以便工厂找到并激活您的 WF 工作流程。如果您在 VisualStudio 中有一个典型的 WP 项目,则完整限定名称是项目名称 + 类名称,请尝试使用此名称。
当您构建工作流 xaml 文件时,编译将生成一个包含代码和逻辑的类,并且遵循 xaml(WPF 和 Silverlight)编译器的相同行为,该类的名称将与文件相同(.xamlx )
Based on what you ask, I understand that you need to expose a WF Workflow as a WCF service and you want client to call directly WF through WCF infrastructure, is that right?
The problem you facing is that you need to provide the full qualified name of the class in order to the factory to find and activated your WF workflow. If you have a typical WP project inside VisualStudio the Full Qualified Name is the name of the project + the class name, try with this.
When you build your workflow xaml file the compile will generate a class that hold and the code and logic, and following the same behavior of the xaml (WPF and Silverlight) compiler the name of the class will be the same of the file (.xamlx)