background image

在上图中,我们看出在当前场景中存在两个服务,即:

BillService

 

(即定单生成)。

ShipOrderService(定单处理:包括处理定单相关信息等)

其中的

BillService 的代码如下:

[ServiceContract(Name = "Billing",

    Namespace = "http://Microsoft.ServicePlatformLabs")]

public class BillingService

{

    [OperationContract(Name = "Invoice", IsOneWay = true)]

    public void Invoice(string orderId, string total)

    {

        Console.WriteLine("Invoice for Order {0} ({1}) generated",

            orderId, total);

    }

}

注:上面的

ServiceContract 属性 Name="Billing"和 OperationContract 属性 Name 

= "Invoice"会以链接方式绑定到工作流 CloudServiceBusSend 活动(activity)

Action 属性上,即:

http://Microsoft.ServicePlatformLabs/Billing/Invoice

ShippingService 的代码如下: