<求助>有WebService开发经验的来看下
这是什么情况?
我先用WebService 做一个访问数据库的服务
这是在android端写的时候出现的问题
顺便说下你们的经验可否
android端代码
程序代码:
// TODO Auto-generated method stub TextView tv=(TextView) this.findViewById(R.id.text); //<span style="color: #008000; text-decoration: underline;">http://127.0.0.1[/color]:28080/axis2/services/SelectProductSerivce?wsdl String url="http://10.0.2.2:28080/axis2/services/SelectProductSerivce?wsdl"; String methodName = "getProduct"; //1.生成SoapObject // SoapObject request=new SoapObject("<span style="color: #008000; text-decoration: underline;">http://com.wuya.ws[/color]", methodName); SoapObject request=new SoapObject("http://ws., methodName); //2.设置参数 request.addProperty("id","2"); //3.Envelope SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); //4将请求放入envelope envelope.bodyOut=request; //5. 生成发送envelope对象(指向服务) HttpTransportSE ht=new HttpTransportSE(url); try { //6.传入envelope并调用服务 ht.call(null, envelope); //7. 处理响应 if(envelope.getResponse()!=null){ //8.处理返回的SoapObject对象 SoapObject soapObject = (SoapObject) envelope.getResponse(); String result = soapObject.getProperty("uname") + "\n"; tv.setText(result); }else{ tv.setText("空"); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (XmlPullParserException e) { // TODO Auto-generated catch block e.printStackTrace(); }