2017-04-19 87 views

回答

1

基於合同的Web服務API有一個簡單的GetFiles接口來獲取實體的所有文件。當你沒有特別的要求迫使你使用基於屏幕的網絡服務API時,我建議你使用基於合同的合約。

接口:

File[] GetFiles(Entity entity) 

用法僞代碼:

using (DefaultSoapClient soapClient = new DefaultSoapClient()) 
{ 
    soapClient.Login("username", "password", "CompanyLoginName", null, null); 

    File[] files = soapClient.GetFiles((Entity)soapClient.Get(new Entity { EntityIntField = new IntSearch { Value = 1 } })); 
} 

合同基於web服務API參考:

http://acumaticaopenuniversity.com/courses/i210-contract-based-web-services/