2015-08-28 34 views
0

我是個新手,asp.net和我有一個WSDL和在它,當我創建一個對象爲服務它顯示如何調用wsdl的函數和類?

那麼,如何使用這個WSDL和調用web「爲抽象類不能創建對象」服務?

sampleservice object = new sampleservice (cannot able to create object) 

    public class Demo : sampleservice .sampleservice 
{ 
    // public string auth_string = "ssampleservice ampleservice "; 
    //public string country_iso = "MY"; 
    sampleservice .used_amount_data useramount = new sampleservice .used_amount_data(); 
    sampleservice .GlobalResponse globalresponse = new sampleservice .GlobalResponse(); 
    sampleservice .CDRPage cdrpage = new sampleservice .CDRPage(); 
    sampleservice .RegionsExt[] regionext = new sampleservice .RegionsExt[]{}; 
    sampleservice .api_sampleservice apidata = new sampleservice .api_didwwdata(); 
    sampleservice .City[] city = new sampleservice .City[] { }; 
    sampleservice .Country[] country = new sampleservice .Country[] { }; 
    sampleservice .Rates[] rates = new sampleservice .Rates[] { }; 
    sampleservice .Regions[] regions = new sampleservice .Regions[] { }; 
    sampleservice .prepaid_data prepaiddata = new sampleservice .prepaid_data(); 

所以如何從抽象類檢索

+0

你不能從抽象的檢索,因爲根據定義,它是抽象的,你不能實例化。您需要從中繼承並使用它。 – Noctis

+0

的WSDL包含了所有的功能和類參數,確定inherite如何從功能 –

回答

0

所以,我怎麼能找回它從抽象類

答案很簡單,你不能。如果您的服務WSDL只是具有abstruct類,那意味着您的服務(OR)沒有實現您嘗試使用的服務的實現。

看看你是否有一個實現你的服務的具體類,並嘗試創建一個使用這個類代理對象。

如果你真的想使用/繼承服務abstruct類,則考慮讓該服務項目dll和消費一樣。

+0

結果,我怎麼可以創建代理對象可以elobarate它? –

+0

他們只提供wsdl網絡服務不dll所以如何消費它? –

+0

這就是我所說的,你的服務必須有一個實現類/具體類。使用該類創建代理。 – Rahul