先说明下我服务器是PHP做的,然后要求用安卓客户端访问服务器内容。PHP服务器那边已经提供了几个方法供我访问数据了,分别是:
interface IHello
{
public String line_categories();
public String companies(int region_id);
public String lines(int region_id);
public String stations(int line_id);
}然后我安卓客户端错误代码是这里:
@Override
public void onClick(View v)
{
// TODO Auto-generated method stub
PHPRPC_Client client = new PHPRPC_Client("http://0771.mygolbs.com:8081/MyBusServer/servlet/MyGoServer.HttpPool.HttpHandlerServlet");
IHello clientProxy = (IHello)client.useService(IHello.class);
System.out.println(clientProxy.line_categories());
System.out.println(clientProxy.companies(450100));
System.out.println(clientProxy.lines(450100));
System.out.println(clientProxy.stations(450100));
//Toast.makeText(getApplicationContext(), "从服务器读取到的数据为:\n" + str, i).show();
}
错误就在输出那里那四个东西,一个方法都通不过,求有解的大神给帮忙指正。
interface IHello
{
public String line_categories();
public String companies(int region_id);
public String lines(int region_id);
public String stations(int line_id);
}然后我安卓客户端错误代码是这里:
@Override
public void onClick(View v)
{
// TODO Auto-generated method stub
PHPRPC_Client client = new PHPRPC_Client("http://0771.mygolbs.com:8081/MyBusServer/servlet/MyGoServer.HttpPool.HttpHandlerServlet");
IHello clientProxy = (IHello)client.useService(IHello.class);
System.out.println(clientProxy.line_categories());
System.out.println(clientProxy.companies(450100));
System.out.println(clientProxy.lines(450100));
System.out.println(clientProxy.stations(450100));
//Toast.makeText(getApplicationContext(), "从服务器读取到的数据为:\n" + str, i).show();
}
错误就在输出那里那四个东西,一个方法都通不过,求有解的大神给帮忙指正。
所以应该是你的实现类,比如: MyHello.class.MyHello implements IHello ...