现在的位置: 首页 > web前端 > 正文

Android学习笔记—29_构建soap协议内容,发送xml数据和调用webservice,手机号码归属地查询器

2019年09月19日 web前端 ⁄ 共 19385字 ⁄ 字号 评论关闭

29_发送xml数据和调用webservice
----------------------------------------
1.发送xml数据给web应用
  a.可以通过参数的方式:比如:http://192.168.1.10:8080/webtest/manage.do?xml=<xml>...</xml>
  b.这里介绍以实体数据发送,如果要调用webservice,要把http协议发送给webservice服务器,所以
    需要把实体数据,封装到http协议里
------------------------------------
2.通过案例学习
--------------
3.理解webservice
 a.client-----发送xml数据-->远程--->webservice服务器-->接收到xml
  数据以后--会根据xml,调用相应的方法名称和参数--->在xml中就有指定的要调用的
  方法名称和参数.
 b.当webservice得到xml后,会进行解析xml,然后会找到相应的方法,利用反射技术执行
 c.当webservice执行完后会返回给client值,它会把执行后的数据封装到xml里面,发给客户端
 d.客户端得到webservice发的xml数据后会解析
 e.所以客户端,可以是语言无关的,可以用其他语言,只要是能接收解析webservice发来的信息
-----------------------------------------------------------------------
4.要先在电脑可以上网之后,才开启模拟器,因为,只有电脑上了网之后,模拟器才可以获取dns
  否则是获取失败的.
---------------------------------
5.webservice实际上就是发布在网络上的api,可以这里去找需要的webservice
  http://www.webxml.com.cn/zh_cn/index.aspx
------------------------------------------------------------------------
6.需要调用手机归属地查询的webservice API,以上网站已经把需要的SOAP协议提供了
  这里提供了几种SOAP的方法:协议方法
  SOAP 1.1

以下是 SOAP 1.2 请求和响应示例。所显示的占位符需替换为实际值。

POST /WebServices/MobileCodeWS.asmx HTTP/1.1
Host: webservice.webxml.com.cn
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://WebXml.com.cn/getMobileCodeInfo"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xmlns:xsd="http://www.w3.org/2001/XMLSchema" 

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <getMobileCodeInfo xmlns="http://WebXml.com.cn/">
      <mobileCode>string</mobileCode>
      <userID>string</userID>
    </getMobileCodeInfo>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xmlns:xsd="http://www.w3.org/2001/XMLSchema" 

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <getMobileCodeInfoResponse xmlns="http://WebXml.com.cn/">
      <getMobileCodeInfoResult>string</getMobileCodeInfoResult>
    </getMobileCodeInfoResponse>
  </soap:Body>
</soap:Envelope>
SOAP 1.2
//------------------------------------------------------------------:---
这里选择这一种
以下是 SOAP 1.2 请求和响应示例。所显示的占位符需替换为实际值。

POST /WebServices/MobileCodeWS.asmx HTTP/1.1
Host: webservice.webxml.com.cn
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xmlns:xsd="http://www.w3.org/2001/XMLSchema" 

xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <getMobileCodeInfo xmlns="http://WebXml.com.cn/">
      <mobileCode>string</mobileCode>
      <userID>string</userID>
    </getMobileCodeInfo>
  </soap12:Body>
</soap12:Envelope>
--------------------------------------------------------------
以上是需要发送给webservice的文件格式
---------------------------------------------------------
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xmlns:xsd="http://www.w3.org/2001/XMLSchema" 

xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <getMobileCodeInfoResponse xmlns="http://WebXml.com.cn/">
      <getMobileCodeInfoResult>string</getMobileCodeInfoResult>
    </getMobileCodeInfoResponse>
  </soap12:Body>
</soap12:Envelope>
-------------------------------
以上是webservice返回给android应用的soap协议的格式
-----------------------------------------------------------------------------
HTTP GET
以下是 HTTP GET 请求和响应示例。所显示的占位符需替换为实际值。
GET /WebServices/MobileCodeWS.asmx/getMobileCodeInfo?mobileCode=string&userID=string 

HTTP/1.1
Host: webservice.webxml.com.cn
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://WebXml.com.cn/">string</string>
HTTP POST

以下是 HTTP POST 请求和响应示例。所显示的占位符需替换为实际值。

POST /WebServices/MobileCodeWS.asmx/getMobileCodeInfo HTTP/1.1
Host: webservice.webxml.com.cn
Content-Type: application/x-www-form-urlencoded
Content-Length: length

mobileCode=string&userID=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://WebXml.com.cn/">string</string>
------------------------------------------------------------------------
2.在soap中指定了方法各项名称和参数
  <?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xmlns:xsd="http://www.w3.org/2001/XMLSchema" 

xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <getMobileCodeInfo xmlns="http://WebXml.com.cn/">//这里指定了方法名称
      <mobileCode>string</mobileCode>//方法参数
      <userID>string</userID>//方法参数
    </getMobileCodeInfo>
  </soap12:Body>
</soap12:Envelope>
--------------------------------------------------
1.获得国内手机号码归属地省份、地区和手机卡类型信息

输入参数:mobileCode = 字符串(手机号码,最少前7位数字),userID = 字符串(商业用户ID) 免

费用户为空字符串;返回数据:字符串(手机号码:省份 城市 手机卡类型)。
---------------------------------------------------------------------------------
2.通过一些工具,监听工具,然后拦截协议内容,然后就可以调用他们的api实现自己的功能
  以实现为自己所用.
---------------------------------------------------------
3.以下是发送xml数据和调用webservice,并且实现归属地查询的代码:
--------------------------------------------------------------------
a.新建android项目:
b./MobileAddressQuery/src/com/credream/mobileAddressQuery/MobileAddressQueryActivity.java
package com.credream.mobileAddressQuery;

import com.credream.service.AddressService;

import android.app.Activity;

import android.os.Bundle;

import android.view.View;

import android.widget.EditText;

import android.widget.TextView;

import android.widget.Toast;

public class MobileAddressQueryActivity extends Activity {

private EditText mobileText;

private TextView textView;  

@Override
   
 public void onCreate(Bundle savedInstanceState) {
 
       super.onCreate(savedInstanceState);
  
      setContentView(R.layout.main);
 
 mobileText=  (EditText) this.findViewById(R.id.mobile);
  
textView=  (TextView) this.findViewById(R.id.textView);
 
   }
    
   
 public void query(View v){
   
String mobile=mobileText.getText().toString();
  
  try
{

String address=AddressService.getAddress(mobile);

textView.setText(address);

} catch (Exception e)
{

e.printStackTrace();

Toast.makeText(getApplicationContext(), R.string.error, 1).show();

}
   
 
   }
}
---------------------------------------------------------------------------
b./MobileAddressQuery/src/com/credream/service/AddressService.java
  package com.credream.service;

import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import org.apache.http.cookie.Cookie;
import org.xmlpull.v1.XmlPullParser;

import android.util.Xml;

import com.credream.util.StreamTool;

/**
 * 用来调用webservice
 * @author xiaofeng
 *
 */
public class AddressService
{
/**
* 获取手机号归属地
* @param mobile 手机号
* @return
* @throws Exception
*/
public static String getAddress(String mobile) throws Exception{
//调用方法得到webservice发来的数据
String soap=readSoap();
soap=soap.replaceAll("\\$mobile", mobile);//$在正则表达式是特殊字符要转义,

二\在java中又是特殊字符,所以要两次转义
//以上完成在soap12.xml中读取数据,然后替换里面的$mobile为用户输入的手机号
//然后把整理后的带有用户手机号信息的soap12.xml协议,发给webservice
byte[] entry=soap.getBytes();

String path="http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx";
HttpURLConnection conn=(HttpURLConnection) new URL(path).openConnection();
conn.setConnectTimeout(5000);
conn.setRequestMethod("POST");
conn.setDoOutput(true);//1.设置允许内容输出,接下来设置内容类型
conn.setRequestProperty("Content-Type", "application/soap+xml; charset=utf-

8;");//2.设置内容类型
conn.setRequestProperty("Content-Length", String.valueOf(entry.length));
//把数据发给webservice
conn.getOutputStream().write(entry);
if (conn.getResponseCode()==200)
{
 return
parseSOAP(conn.getInputStream());
}
return null;
}
/**
 * 用来将得到的webservice返回的信息,进行解析
 * @param inputStream
 */

//----------------------------------------------------------------------------------

/* 下面是webservice返回的结果信息格式
* HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-

instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 

xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
 <soap12:Body>
   <getMobileCodeInfoResponse xmlns="http://WebXml.com.cn/">
   //XmlPullParser.START_TAG:这里是开始标记
     <getMobileCodeInfoResult>string</getMobileCodeInfoResult>
   </getMobileCodeInfoResponse>
 </soap12:Body>
</soap12:Envelope>*/

//---------------------------------------------------------------------------
private static String parseSOAP(InputStream xml) throws Exception
{
XmlPullParser pullParser=Xml.newPullParser();
pullParser.setInput(xml,"UTF-8");
int event=pullParser.getEventType();
while(event!=XmlPullParser.END_DOCUMENT){
switch (event)
{
case XmlPullParser.START_TAG:
if("getMobileCodeInfoResult".equals(pullParser.getName())){
return pullParser.nextText();
}
break;
}
event=pullParser.next();
}
return null;

}
/**
 * 读取本地的soap12.xml文件返回String
 * @return
 * @throws Exception
 */
private static String readSoap() throws Exception
{
InputStream inStream=AddressService.class.getClassLoader

().getResourceAsStream("soap12.xml");
   byte[] data=StreamTool.read(inStream);
return new String(data);
}

}
-------------------------------------------------------------------------------------
3./MobileAddressQuery/src/com/credream/test/XMLTest.java
  这个类用于测试post封装的.执行方法,就可以测试,把person.xml发送给web服务器,然后由web
  服务器进行解析.进行显示:person.xml文件的内容.
----------------------------------------------------
a.package com.credream.test;

import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import org.junit.Test;

import com.credream.util.StreamTool;

import android.test.AndroidTestCase;

public class XMLTest extends AndroidTestCase
{

@Test
public void testSendXml() throws Exception
{
InputStream inStream=this.getClass().getClassLoader().getResourceAsStream

("person.xml");
    byte[] data=StreamTool.read(inStream);
    //String xml=new String(data,"");
String path="http://192.168.0.110:6118/MobileAddressQueryTest/XmlServlet";
HttpURLConnection conn= (HttpURLConnection) new URL(path).openConnection();
conn.setConnectTimeout(5000);
conn.setRequestMethod("POST");
conn.setDoOutput(true);//1.设置允许内容输出,接下来设置内容类型
conn.setRequestProperty("Content-Type", "text/xml; charset=UTF-8");//2.设置内容类


conn.setRequestProperty("Content-Length", String.valueOf(data.length));
//3.取出输出流然后发送给对方web应用
conn.getOutputStream().write(data);
    //4.这时候没有真正的发送给对方,而是写到了自己的缓冲区中
if(conn.getResponseCode()==200){//这时候才能取得
System.out.println("发送成功");
}else {
System.out.println("发送失败");
}
//5.以上是利用http协议封装实体数据进行发送给web应用的.
}

}

-------------------------------------------------------------------------------
/MobileAddressQuery/src/com/credream/util/StreamTool.java
package com.credream.util;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
/**
 * 读取流中的数据
 * @author xiaofeng
 *
 */
public class StreamTool
{
public static byte[] read(InputStream inStream) throws Exception{
ByteArrayOutputStream outStream=new ByteArrayOutputStream();
byte[] buffer=new byte[1024];
int len=0;
while((len=inStream.read(buffer))!=-1){
outStream.write(buffer,0,len);//往内存写数据
}
inStream.close();
return outStream.toByteArray();
}

}  
----------------------------------------------------------------------------
1.MobileAddressQueryTest
  这个是web项目,用来执行Android应用中的testSendXml方法
------------------------------------------
package com.credram.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.credream.util.StreamTool;
public class XmlServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
 
//super.doGet(req, resp);//以上很多错误都是因为多了这句话造成的.,因为父类

的这个方法,默认的返回是405的错误,所以会报这个错误
}

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
//1.web应用需要取得android应用发来的http协议封装的实体数据
try
{
//2.使用工具类,自己写的,读取传来的数据
  byte[] data=StreamTool.read(request.getInputStream());
String xml=new String(data,"UTF-8");
//3.这里需要知道,android系统用的是utf-8编码,而本机用的是gbk编码所以这里需要转码
System.out.println(xml);
} catch (Exception e)
{
e.printStackTrace();
}
}

}
---------------------------------------------------------------
/MobileAddressQueryTest/src/com/credream/util/StreamTool.java
package com.credream.util;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
/**
 * 读取流中的数据
 * @author xiaofeng
 *
 */
public class StreamTool
{
public static byte[] read(InputStream inStream) throws Exception{
ByteArrayOutputStream outStream=new ByteArrayOutputStream();
byte[] buffer=new byte[1024];
int len=0;
while((len=inStream.read(buffer))!=-1){
outStream.write(buffer,0,len);//往内存写数据
}
inStream.close();
return outStream.toByteArray();
}

}
-------------------------------------------------------------------
/MobileAddressQueryTest/WebContent/WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xmlns="http://java.sun.com/xml/ns/javaee" 

xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>VideoNews</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <description></description>
    <display-name>ListServlet</display-name>
    <servlet-name>ListServlet</servlet-name>
    <servlet-class>com.credram.servlet.ListServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ListServlet</servlet-name>
    <url-pattern>/ListServlet</url-pattern>
  </servlet-mapping>
  <servlet>
    <description></description>
    <display-name>ManagerServlet</display-name>
    <servlet-name>ManagerServlet</servlet-name>
    <servlet-class>com.credram.servlet.ManagerServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ManagerServlet</servlet-name>
    <url-pattern>/ManagerServlet</url-pattern>
  </servlet-mapping>
  <filter>
    <filter-name>myfilter</filter-name>
    <filter-class>com.credream.filter.EncodingFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>myfilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <servlet>
    <description></description>
    <display-name>XmlServlet</display-name>
    <servlet-name>XmlServlet</servlet-name>
    <servlet-class>com.credram.servlet.XmlServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>XmlServlet</servlet-name>
    <url-pattern>/XmlServlet</url-pattern>
  </servlet-mapping>
</web-app>
-------------------------------------------------------------------------------
1.查询号码归属地中出现的异常:
 java.net.SocketTimeoutException: Transport endpoint is not connected
at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl

(Native Method)
at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocket

(OSNetworkSystem.java:130)
at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:246)
at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:533)
at java.net.Socket.connect(Socket.java:1055)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>

(HttpConnection.java:62)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get

(HttpConnectionPool.java:88)
at 

org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnec

tion(HttpURLConnectionImpl.java:927)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect

(HttpURLConnectionImpl.java:909)
at 

org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.sendRequest

(HttpURLConnectionImpl.java:1325)
at 

org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.doRequestInte

rnal(HttpURLConnectionImpl.java:1656)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.doRequest

(HttpURLConnectionImpl.java:1649)
at 

org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getOutputStre

am(HttpURLConnectionImpl.java:1248)
at com.credream.test.XMLTest.testSendXml(XMLTest.java:31)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
//这里应该是url出错的问题:
  String path="http://192.168.0.110:6118/MobileAddressQueryTest/XmlServlet";
  写成局域网的地址.
----------------------------------------------------------------------------------------
2.type Status report
  message HTTP method GET is not supported by this URL
  description The specified HTTP method is not allowed for the requested resource (HTTP   

method GET is not supported by this URL).

访问时,一直报错:

type: Status report

message: HTTP method GET is not supported by this URL

description: The specified HTTP method is not allowed for the requested resource (HTTP 

method GET is not supported by this URL).
经过上网查询,原因如下:

1,继承自HttpServlet的Servlet没有重写对于请求和响应的处理方法:doGet或doPost等方法;默认调

用父类的doGet或doPost等方法; 

2,父类HttpServlet的doGet或doPost等方法覆盖了你重写的doGet或doPost等方法;

不管是1或2,父类HttpServlet的doGet或doPost等方法的默认实现是返回状态代码为405的HTTP错误表

示//
对于指定资源的请求方法不被允许。
解决方法: 

1,子类重写doGet或doPost等方法;

 2,在你扩展的Servlert中重写doGet或doPost等方法来处理请求和响应时 不要调用父类HttpServlet

doGet或doPost等方法,即去掉super.doGet(request, response)和super.doPost(request, 

response);
---------------------------------------------------
3.Failed to install *.apk on device 'emulator-5554': timeout 
  错误提示:
Failed to install helloworld.apk on device 'emulator-5554': timeout
或者
the user data image is used
原因:

由于模拟器已经开启而没有关闭或者非法关闭引起的。
解决方法:
删除 C:\Documents and Settings\Administrator\.android\avd\对应版本.avd
下所有以.lock结尾的文件夹。
或者
Failed to install *.apk on device *:

timeout Launch canceled!

 还有一种办法:
在window->preferences->Android->DDMS->ADB connection time out (ms):  
将这个值设置的大一些,默认为5000,我设置成500000,然后就OK了。
我有一次试N种方法都解决不了,后来就是用这个办法解决的。
-------------------------------------------------------------------------
1.Android java.net.SocketException: Address family not supported by protocol 出错提示 
  这个异常是因为
 1.Android java.net.SocketException: Address family not supported by protocol 出错提示 
这个异常是因为
package com.credram.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
mport javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.credream.util.StreamTool;
public class XmlServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
 
//super.doGet(req, resp);//以上很多错误都是因为多了这句话造成的.,因为父类的这个方法,默认的

返回是405的错误,所以会报这个错误
}

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
//1.web应用需要取得android应用发来的http协议封装的实体数据
try
{
//2.使用工具类,自己写的,读取传来的数据
 byte[] data=StreamTool.read(request.getInputStream());
String xml=new String(data,"UTF-8");
//3.这里需要知道,android系统用的是utf-8编码,而本机用的是gbk编码所以这里需要转码
System.out.println(xml);
} catch (Exception e)
{
e.printStackTrace();
}}
}
----------------------------------------------------------------------------
3.在程序中出现了:soap中的电话号码总是没有替换过了,这个原因是:
 String soap=readSoap();
 soap.replaceAll("\\$mobile", mobile);
 注意:这里是因为replaceAll创建的字符串为新的字符串,这时候需要,从新把它的引用给变量soap才行
      也就是写成:soap= soap.replaceAll("\\$mobile", mobile);
---------------------------------------------------------------
下面是个例子程序:
public class test
{
public static void main(String[] args)
{ StringBuilder builder=new StringBuilder();
 builder.append("123");
 String syString="gasdgasdgsdlidewei";
 syString.replaceAll("lidewei", "xiaofeng");
System.out.println(builder);
System.out.println(syString);
}
}
-----------------------------------------------------------------------

抱歉!评论已关闭.