2012-09-06 68 views

回答

1

Invoking WCF Service without adding a Service Reference.工作greate提供我知道合同。因此,我首先添加了Web引用,將生成的代理複製到實際項目中,然後刪除了Web引用並簡單地稱爲方法爲

  BasicHttpBinding binding = new BasicHttpBinding(); 
      EndpointAddress epAddr = new EndpointAddress("http://192.168.0.233/GMS/GMSService.svc"); 
      GMSContract.IGMSService _interface = ChannelFactory<GMSContract.IGMSService>.CreateChannel(binding, epAddr);   
... 
      bool r = _interface.MyGMSMethod(..., ref ..., out ..., out ...);