Java??c#???hessian???
???????????? ???????[ 2014/9/19 13:03:53 ] ??????????????? Java
????????????????Hessiancsharp.dll???á?
???????????
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using hessiancsharp.client;
using hessian.test.server;
namespace HessianClientTest
{
class Program
{
static void Main(string[] args)
{
string url = @"http://localhost:8080/HessianServerTest/hessian";
CHessianProxyFactory factory = new CHessianProxyFactory();
IHello test = (IHello)factory.Create(typeof(IHello)?? url);
//Test function
Console.WriteLine(test.sayHello("lu")); //?????????????????????
test.sayHello2(12); //???????????????? "Hello 12"
test.print("hessian"); //???????????????? "hessian"
//Test Object
HelloBean bean = new HelloBean();
//bean.setName("lu xiaoxun");
bean.Name = "luxiaoxun";
HelloBean result = test.getData(bean);
Console.WriteLine(result.Name);
Console.WriteLine(result.Age);
Console.WriteLine(result);
//Test Object Array
HelloBean[] beans = test.getBeanList();
if (beans != null)
{
foreach (HelloBean data in beans)
{
Console.WriteLine(data.ToString());
}
}
//Test complex data
ComplexData complexData = test.getComplexData();
if (complexData != null)
{
Console.WriteLine("Array number: " + complexData.GetNumber());
HelloBean[] comArray = complexData.GetBeans();
if (comArray != null)
{
foreach (HelloBean data in comArray)
{
Console.WriteLine(data.ToString());
}
}
//Dictionary<String?? HelloBean> helloBeanMap = complexData.GetBeansDic();
//if (helloBeanMap != null)
//{
// foreach (String key in helloBeanMap.Keys)
// {
// Console.WriteLine(helloBeanMap[key].GetHelloBeanInfo());
// }
//}
}
Console.ReadKey();
}
}
}
????????????
???????????
????1???????????????????????????????????????
????IHello?????????????????????????????£?????IHello???????HelloBean??ComplexData??Java??????C#???????????HelloBean???????????????????
????2????????????
????????????????????????????????????£???????????????£???
????3??????????????л?
????4??????????????????????
???????????????????????????????????????????????????????????????????ArrayList?????????????C#????????Array???飩?????????HashMap??????????????C#??????Dictionary????????£???????????hash?????????????μ??μ?????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11