在BizTalk Server 2006 R2 中调用 WCF Services – Part 2

在BizTalk Server 2006 R2 中调用 WCF Services – Part 2


前一部分文章:
在BizTalk Server 2006 R2 中调用 WCF Services – Part 1


2. 构建BizTalk Orchestration 流程
在BizTalk Orchestration 流程中,我们定义如下的流程,演示如何通过WCF Adapter调用 WCF Services中的方法。


 
这里,演示了调用WCF Services 的 AddAccount方法和GetAccounts方法。
 
在调用WCF Services 的AddAccount 方法之前,需要准备好要传入的参数,示例中采用BizTalk Map 进行消息的转换。



 
在调用WCF Services 的GetAccounts 方法之前,也需要准备好要传入的参数,示例中采用Message Assignment / Biztalk 表达式编辑器进行消息的构造。示例代码如下:
 
System.Diagnostics.EventLog.WriteEntry(" === start to build msgGetAccounts === ", "start");
 
xmlDoc = new System.Xml.XmlDocument();
xmlDoc.LoadXml("<ns0:GetAccounts xmlns:ns1=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\" xmlns:ns0=\"http://Microsoft.ServiceModel.Samples\"> </ns0:GetAccounts>");
msgGetAccounts.parameters = xmlDoc;
 
System.Diagnostics.EventLog.WriteEntry(" === end === ", "end");
 
在上述BizTalk Orchestartion 流程图右边的Port 端口,是WCF Services 的逻辑端口,在导入WCF Services 元数据的过程中产生的。




 
下一步将演示如何部署BizTalk 项目,配置WCF Adapter,并演示对 WCF Services 的调用。
 
欢迎到 http://forum.entlib.com BizTalk 论坛交流分享。
 

posted on 2008-08-04 23:41  EntLib  阅读(1428)  评论(2)    收藏  举报