客户端 public class ksoap2webservice { private static final String URL = "http://192.168.1.1/WebSite/Service.asmx"; private static final String NAMESPACE = "http://tempuri.org/"; private static final String METHOD_NAME = "Test"; private static final String SOAP_ACTION = "http://tempuri.org/Test"; public static String callWebService() throws Exception{ SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); request.addProperty("strIn", "123456"); byte []byValue = new byte[]{0,1,2,3,'a', 'b'}; String strByte = Base64.encode(byValue); request.addProperty("request", strByte); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11 ); envelope.dotNet = true; envelope.setOutputSoapObject(request); new MarshalBase64().register(envelope); //发出请求 AndroidHttpTransport aht = new AndroidHttpTransport(URL); //aht.debug = true; aht.call(SOAP_ACTION, envelope); SoapObject soResult = (SoapObject)envelope.bodyIn; SoapPrimitive spRespose = (SoapPrimitive)soResult.getProperty("respose"); String getReturn = new String(Base64.decode(spRespose.toString()), "utf-8"); return getReturn; } } 服务端 [WebMethod] public int Test(string strIn,byte[] request, out byte[] respose) { string s = "cccca连111接222222"; respose = System.Text.Encoding.UTF8.GetBytes(s); return respose.Length; }