-1
有一個WCF服務ServiceOne。它所做的就是實現一些函數,比如int Add(int a,int b);關於使用WCF服務感到困惑
當我使用這樣的另一個項目此服務:
ServiceOneClient client = new ServiceOneClient();
int result = client.Add(10,10);
,它工作正常。
但現在我要創建一個簡單地實現這樣的
int ServiceTwoAddMethod(int a, int b)
{
return new ServiceOneClient().Add(a, b);
}
ServiceOne功能的另一個服務ServiceTwo而且我覺得一切都應該正常工作。但不知何故,當我到ServiceTwo添加參照第三個項目, 這行代碼
new ServiceTwoClient().Add(10, 10)
的不回什麼,我想看看(20)。
請告訴我我做錯了什麼?
我不認爲有足夠的信息給你一個答案。 – 2011-05-18 13:39:16
ServiceTwoClient.Add方法返回什麼? – 2011-05-18 13:40:02
您是否添加引用或服務引用? – 2011-05-18 13:51:27