再问soap/webservice问题
刚学SOAP,不得要领,呵呵,这里有一个问题,还请有经验的达人高手不吝指教:
手上收到一个webservice的编写任务,下面是对方给的接口描述(好像是c#的)
/*----------------------------------------------------*/
PriceInfo 商品价格信息
public class PriceInfo {
private String productid; //商品ID
private String dealerid; //经销商ID
}
接口定义:
public interface PriceAdapter {
public PriceInfo[] getPriceInfo(String productid);
}
1.接口函数说明:
public PriceInfo[] getPriceInfo(String productid);
参数:productid:商品ID。
返回值:PriceInfo[]:商品价格信息列表。
/*----------------------------------------------------*/
我用cbc定义如下:
//经销商信息
class PriceInfo : public TRemotable
{
private:
AnsiString Fdealername; //经销商名称
AnsiString Fcreditlevel; //信用级别
public:
__published:
__property AnsiString dealername = {read=Fdealername,write=Fdealername};
__property AnsiString creditlevel = {read=Fcreditlevel,write=Fcreditlevel};
};
问题是要接口函数要返回经销商信息列表,也就是说不止一个经销商,这个函数怎么定义呢?
PriceInfo* getPriceInfo(String productid);还是PriceInfo** getPriceInfo(String productid);
第二种肯定不行,编译器认为返回类型不是TRemotable的子类型,但第一种方式怎么能返回DealerInfo类型的数组呢?