webservice
来源:互联网 发布:go语言编程 pdf 编辑:程序博客网 时间:2024/06/16 03:21
虽然已经过时但是还是可以玩一玩挺有趣的,主要是能获得一些自己先要知道的东西 例子为写的获得手机号码 以及跟手机号码有关的东西
但是自己找接口
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
public void dianji(){ //找到服务器地址 SoapSerializationEnvelope tion = new SoapSerializationEnvelope(SoapEnvelope.VER11); //得到命名空间 第一个参数: targetNamespace="http://WebXml.com.cn/" 第二个参数 :-<wsdl:operation name="getMobileCodeInfo"> SoapObject so = new SoapObject("http://WebXml.com.cn/","getMobileCodeInfo"); //得到请求(添加请求参数) 第一个参数:<s:element name="getMobileCodeInfo"> // -<s:complexType> -<s:sequence> // <s:element name="mobileCode" type="s:string" maxOccurs="1" minOccurs="0"/> // <s:element name="userID" type="s:string" maxOccurs="1" minOccurs="0"/> //第二个参数 :有详细的介绍 so.addProperty("mobileCode","18716059513"); so.addProperty("userID","3441d22d7f9a456599fcc0d01eb1f42f");//第二个界面 tion.bodyOut = so; tion.dotNet = true; HttpTransportSE hse = new HttpTransportSE("http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx");//<soap:address location="http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx"/> try { hse.call("http://WebXml.com.cn/getMobileCodeInfo",tion);//Ctrl+f 查找 soapAction="http://WebXml.com.cn/getMobileCodeInfo"/> if(tion.getResponse()!=null){ SoapObject sot = (SoapObject) tion.bodyIn; Log.d("pl",sot.toString()); } } catch (Exception e) { e.printStackTrace(); } }}
阅读全文
0 0
- WebService
- WebService
- webservice
- webservice
- WebService
- webservice
- webService
- WebService
- WebService
- webService
- WEBService
- webService
- WebService
- [WebService]
- webservice
- WebService
- webservice
- WebService
- 一致性哈希算法简介:简单的自我理解 与 一些摘抄的资料
- 老人与流浪狗
- 并发服务器select
- jdk 源码分析(7)java ReentrantLock结构
- SpringBoot中Pageable的简单分页排序查询
- webservice
- Java / Android 基于Http的多线程下载的实现
- 设计模式之禅笔记--面向对象设计六大原则之一
- ArgumentError: invalid byte sequence in UTF-8 Use --trace for backtrace.
- 排序——归并排序
- RHEL7.4发布了
- 0和5(思维-水题)
- python socket
- SQL查询和优化(一)