public static AStockServicePrx read(global::Ice.InputStream istr) { global::Ice.ObjectPrx proxy = istr.readProxy(); if (proxy != null) { AStockServicePrxHelper result = new AStockServicePrxHelper(); result.iceCopyFrom(proxy); return(result); } return(null); }
public static AStockServicePrx uncheckedCast(global::Ice.ObjectPrx b, string f) { if (b == null) { return(null); } global::Ice.ObjectPrx bb = b.ice_facet(f); AStockServicePrxHelper h = new AStockServicePrxHelper(); h.iceCopyFrom(bb); return(h); }
static void Main(string[] args) { using (var communicator = Util.initialize(ref args)) //创建Communicator对象 { ObjectPrx basePrx = communicator.stringToProxy("AStockService:default -p 10000"); //创建客户端基类代理 AStockServicePrx aStockServicePrx = AStockServicePrxHelper.checkedCast(basePrx); //把基类代理转换为子类代理 var companyInfo = aStockServicePrx.GetCompanyInfo(1000); //调用GetCompanyInfo方法 Console.WriteLine($"id:{companyInfo.id} name:{companyInfo.name} addr:{companyInfo.addr}"); //输出返回结果 } Console.Read(); }
public static AStockServicePrx uncheckedCast(global::Ice.ObjectPrx b) { if (b == null) { return(null); } AStockServicePrx r = b as AStockServicePrx; if (r == null) { AStockServicePrxHelper h = new AStockServicePrxHelper(); h.iceCopyFrom(b); r = h; } return(r); }
public static AStockServicePrx checkedCast(global::Ice.ObjectPrx b, global::System.Collections.Generic.Dictionary <string, string> ctx) { if (b == null) { return(null); } AStockServicePrx r = b as AStockServicePrx; if ((r == null) && b.ice_isA(ice_staticId(), ctx)) { AStockServicePrxHelper h = new AStockServicePrxHelper(); h.iceCopyFrom(b); r = h; } return(r); }
public static AStockServicePrx checkedCast(global::Ice.ObjectPrx b, string f, global::System.Collections.Generic.Dictionary <string, string> ctx) { if (b == null) { return(null); } global::Ice.ObjectPrx bb = b.ice_facet(f); try { if (bb.ice_isA(ice_staticId(), ctx)) { AStockServicePrxHelper h = new AStockServicePrxHelper(); h.iceCopyFrom(bb); return(h); } } catch (global::Ice.FacetNotExistException) { } return(null); }
public static AStockServicePrx checkedCast(global::Ice.ObjectPrx b, string f) { if (b == null) { return(null); } global::Ice.ObjectPrx bb = b.ice_facet(f); try { if (bb.ice_isA(ice_staticId())) { AStockServicePrxHelper h = new AStockServicePrxHelper(); h.iceCopyFrom(bb); return(h); } } catch (global::Ice.FacetNotExistException) { } return(null); }