日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當前位置:首頁 > 芯聞號 > 充電吧
[導讀]遇到問題記錄一下: 1.手機訪問電腦web的,記得關閉防火墻!2.不要使用localhost,指定IP地址.import?org.ksoap2.SoapEnvelope; import?org.kso

遇到問題記錄一下: 1.手機訪問電腦web的,記得關閉防火墻!2.不要使用localhost,指定IP地址.

import?org.ksoap2.SoapEnvelope;
import?org.ksoap2.serialization.MarshalBase64;
import?org.ksoap2.serialization.SoapObject;??
import?org.ksoap2.serialization.SoapSerializationEnvelope;??
import?org.ksoap2.transport.HttpTransportSE;??

public?void?onClick_Event(View?view)?
	{
		TextView?txt1?=?(TextView)findViewById(R.id.textView1);
String?nameSpace?=?"http://192.168.0.103/soap/updateserver";??
//?調用的方法名稱???
String?methodName?=?"getVersion";??
String?phoneSec?=?"12312321323";
//?EndPoint???
String?endPoint?=?"http://192.168.0.103/php/index.php?wsdl";??
//?SOAP?Action???
String?soapAction?=?"http://192.168.0.103/php/index.php/getVersion";??
?
//?指定WebService的命名空間和調用的方法名???
SoapObject?rpc?=?new?SoapObject(nameSpace,?methodName);??
?
//?設置需調用WebService接口需要傳入的兩個參數(shù)mobileCode、userId???
rpc.addProperty("appcode",?phoneSec);??

?
//?生成調用WebService方法的SOAP請求信息,并指定SOAP的版本???
SoapSerializationEnvelope?envelope?=?new?SoapSerializationEnvelope(SoapEnvelope.VER10);??
??
envelope.bodyOut?=?rpc;??
//?設置是否調用的是dotNet開發(fā)的WebService???
envelope.dotNet?=?false;??
//?等價于envelope.bodyOut?=?rpc;???
envelope.setOutputSoapObject(rpc);??
?
HttpTransportSE?transport?=?new?HttpTransportSE(endPoint);??
try?{??
????//?調用WebService???
????transport.call(soapAction,?envelope);??
????
????//?獲取返回的數(shù)據(jù)???
SoapObject?object?=?(SoapObject)?envelope.bodyIn;??
//?獲取返回的結果???
if(object?!=null){
String?result?=?object.getProperty(0).toString();?
	//?將WebService返回的結果顯示在TextView中???
	???txt1.setText(result);??
	}
}?catch?(Exception?e)?
{??
	txt1.setText(e.getMessage().toString());
	e.printStackTrace();??
????return?;
}??
}
本站聲明: 本文章由作者或相關機構授權發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內容真實性等。需要轉載請聯(lián)系該專欄作者,如若文章內容侵犯您的權益,請及時聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關閉