2015-08-28 36 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