在 BizTalk 2006 R2 中使用 WCF 服务
我试图弄清楚如何在 BizTalk 2006 R2 中使用 WCF 服务(发送请求并接收响应)。
我已经完成了“添加生成的项目”向导。 现在我试图找出如何在编排中使用它生成的项目。
应该如何提出请求?
I'm trying to figure out how to consume a WCF service in BizTalk 2006 R2 (sending a request and receiving a response).
I've gotten as far as going through the "Add Generated Items" wizard. Now I am trying to find out how to use the items it generated in an orchestration.
How should the request be made?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
下面是如何执行此操作的描述 - 我将假设至少具备 BizTalk 映射等内容的基本知识,如果您需要更多详细信息,请告诉我,我会更新。
在 BizTalk 中生成项目后,您应该(至少):
一个 .Binding.xml 文件描述 WCF 服务公开的服务契约,并允许在 BizTalk 中轻松配置
将端口从工具箱拖到业务流程设计器界面。
该端口应具有请求和响应操作消息它们应该已自动配置为使用 WCF 服务的消息。 如果您的服务公开多个操作,您将看到此处反映出来。
使用标准 BizTalk 映射方法,将要发送到 WCF 服务的数据映射到 WCF 端口的请求消息中。 (您可能希望在编排设计器中将消息名称更改为比默认的 message_1、message_2...更好的名称)
将“接收”和“发送”形状拖到编排设计器上,并将它们连接到正确的端口消息。
连接 BizTalk 编排的其余部分以从适当的源系统获取数据(这只是基本的 BizTalk,而不是 WCF)
部署 BizTalk 应用程序。
应用程序现已准备就绪,您可以将其部署到 BizTalk。
配置 BizTalk 应用程序
对于大多数端口来说,这就像任何其他 BizTalk 应用程序一样 - 只是处理 WCF 服务的端口有所不同。
对于 WCF 端口,您有(至少在开始时)两个主要选项:
配置您自己的 WCF 发送端口。
首先(对于基本的 Web 服务),这通常是 WCF-BasicHttp。
一旦掌握了基础知识,您可能想返回此处并尝试自定义绑定中可用的选项 - 那里有很多!
例如 http://localhost/WCF/myservice.svc
例如 http://tempuri.org/IMyContract/MyMethod
现在创建了 WCF 端口,您可以绑定编排端口。
完成所有这些后,您应该能够启动 BizTalk 应用程序并且一切正常。
可能有帮助的一件事 - 错误将被写入事件日志,它们可能没有帮助,但您还应该能够在挂起的消息视图中看到从服务返回的任何肥皂故障消息。
祝你好运!
Below is a description of how to do this - I'm going to presume at least basic knowledge of things like BizTalk mapping, please let me know if you need any more detail and I'll update.
After generating the items in BizTalk you should have (at the least):
A .Binding.xml file that describes the service contract exposed by the WCF service and allows easy configuration in BizTalk
Drag a Port from the toolbox onto the orchestration designer surface.
This port should have Request and Response operation messages and they should have been automatically configured to use the messages for your WCF service. If your service exposes multiple operations, you will see that reflected here.
Using standard BizTalk mapping methods, map the data you want to send to the WCF service into the request message for the WCf port. (you may want the change the message names in the orchestration designer to be something better than the default message_1, message_2...)
Drag Receive and Send shapes onto the orchestration designer and connect them to the right Port messages.
Wire up the rest of the BizTalk orchestration to take data from appropriate source systems (this is just basic BizTalk, not WCF)
Deploy the BizTalk application.
The application is now ready to go, you can deploy it to BizTalk.
Configure the BizTalk application
For most of the ports this is just like any other BizTalk application - only the ports that deal with the WCF service differ.
For the WCF ports you have (at least to begin with) two main options:
Configure your own WCF send port.
To begin with (for a basic Webservice) this will often be WCF-BasicHttp.
Once you have the basics working you might want to return here and experiment with the options available in the Custom binding - there is a LOT there!
e.g. http://localhost/WCF/myservice.svc
e.g. http://tempuri.org/IMyContract/MyMethod
With your WCF port now created you can bind the orchestration ports to it.
Once all this is done, you should be able to start the BizTalk application and things should work.
One thing that may help - errors will be written to the event log, they may not be helpful, but you should also be able to see any soap fault messages returned from the service in the suspended message view.
Good luck!
如果您只是使用 BizTalk 来编排 WCF 服务,那么 BizTalk 就显得有些过分了。 您可以更轻松地在 Windows Workflow Foundation 内的 .NET 3.5 中使用 WCF 服务。
也就是说,这里的截屏视频应该有所帮助:
http://www.pluralsight.com/community/blogs/aaron/archive/2007/11/15/49172.aspx
BizTalk is overkill if you are just using it to orchestrate WCF services. You can use WCF services in .NET 3.5 inside of Windows Workflow Foundation a bit more easily.
That said, here is a screencast that should help:
http://www.pluralsight.com/community/blogs/aaron/archive/2007/11/15/49172.aspx
与BizTalk中的其他Service开发一样,非常简单。 让事情变得更简单。
目前服务已开发完成。 让我们为它的客户做点什么。
我认为这是我尝试做的最简单的。
谢谢
阿卜杜勒·阿齐兹·法鲁奇。
Its is very simple as other Service development in BizTalk. Let make it more simpler.
Now Service has been Develop. Lets do something for its Client.
I Think this is the most simplest which i tried to make.
Thanks
Abdul Aziz Farooqi.