发送字母或者字符的数据都会报错,只有输发送数字信息才不会报错。为什么?
这是报错的信息:
仔细看看你的 <spanstyle="color:#303942;font-family:'dejavusansmono',monospace;font-size:11px;line-height:normal;background-color:#FFFFFF;">ShangchuanitActivity.java文件的73行 应该是某变量或方法调用不当引起恩找到原因了恩找到原因了回复<aclass='referer'target='_blank'>@会飞的云:web端的php代码不用贴,只需关注java出错处的即可,你是否可以贴出出错时的第73行(+-10行)代码的截图?最好带有行号或标记哪行为73行贴上代码了能帮忙看下吗代码呢代码贴后面了代码好长的 以我多年的helloworld经验,一定是代码写的有问题没代码说个蛋蛋--
<spanstyle="font-family:Verdana,sans-serif,宋体;font-size:14px;line-height:normal;background-color:#FFFFFF;">没代码说个蛋蛋--<spanstyle="color:#303942;font-family:'dejavusansmono',monospace;font-size:12px;line-height:normal;background-color:#FFFFFF;">ShangchuanitActivity.java文件的73行这里的问题,你看看,调试一下。感觉73行是对的啊
代码:
publicstaticString[]shangchuand_wenzhang_it(Stringname,Stringti,Stringcon)
{
String[]strs=null;
StringSOAP_ACTION="urn:hellowsdl2#hello";
StringMETHOD_NAME="shangchuan";
StringNAMESPACE="urn:hellowsdl2";
StringURL="http://<spanstyle="background-color:#000000;">xj18010664305.vicp.cc/WebService/nusoapService.php";
SoapObjectrequest=newSoapObject(NAMESPACE,METHOD_NAME);
request.addProperty("method1",name);
request.addProperty("method2",ti);
request.addProperty("method3",con);
SoapSerializationEnvelopeenvelope=newSoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet=true;
HttpTransportSEandroidHttpTransport=newHttpTransportSE(URL);
try{
androidHttpTransport.call(SOAP_ACTION,envelope);
SoapObjectresultRequestSOAP=(SoapObject)envelope.bodyIn;
StringencodedImage=resultRequestSOAP.getProperty("return").toString();
encodedImage=encodedImage.replaceAll("^\[+|\]+$","");
strs=encodedImage.split(",");
}catch(Exceptione){
e.printStackTrace();
}
returnstrs;
}
--------------------------------------------------------------------------------------
privateclassButtonListenerimplementsOnClickListener{
publicvoidonClick(Viewv){
Stringti=title12.getText().toString();
Stringcon=content12.getText().toString();
switch(v.getId()){
caseR.id.bt_ziliao_shangchuan:
result=Tool.shangchuand_wenzhang_it("table_it",ti,con);
if(result[0]!="0") //73行是这句
{
Toast.makeText(ShangchuanitActivity.this,"suceess",Toast.LENGTH_SHORT).show();
}
else
Toast.makeText(ShangchuanitActivity.this,"failed",Toast.LENGTH_SHORT).show();
break;
default:
break;
}
}
---------------------------------------------------------------------------
web端ksoap配置:
$server->register('db_search31', //methodname
array('d_method1'=>'xsd:string','d_method2'=>'xsd:string','d_method3'=>'xsd:string'), //inputparameters
array('return'=>'tns:SweepstakesGreeting'), //outputparameters
'urn:hellowsdl2', //namespace
'urn:hellowsdl2#hello', //soapaction
'rpc', //style
'encoded', //use
'' //documentation
);
---------------------------------------------------------------------
php代码:
functiondb_search31($d_method1,$d_method2,$d_method3){
$row1=array();
$greeting='INSERTINTO'.$d_method1.'(title,content)VALUES('.$d_method2.','.$d_method3.');';
$result=mysql_query($greeting)ordie('Couldnotconnect:'.mysql_error());
$i=0;
if(!$result)
{
$row1=array("0");
}
$row1=array("1");
return$row1;
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。