Android在网络中与JavaWeb的项目进行交互的方法(2)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-18 20:55 点击:次
soapObject.addProperty("arg1", num2);
//创建SoapSerializationEnvelope对象,并设置WebService版本号
SoapSerializationEnvelope serializationEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
//设置serializationEnvelope对象的badyOut属性
serializationEnvelope.bodyOut = soapObject;
//创建HttpTransportSE对象,并且确定wsdl网络地址
HttpTransportSE httpTransportSE = new HttpTransportSE(wsdl);
try {
//httpTransportSE调用Call方法
httpTransportSE.call(null, serializationEnvelope);
//获取返回的结果对象
if(serializationEnvelope.getResponse() != null){
Object obj = serializationEnvelope.getResponse();
//显示获取到的结果对象
Toast.makeText(getApplicationContext(), "结果为:"+obj.toString(), Toast.LENGTH_LONG).show();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>