Android 传递参数
如何在android中将参数值传递给webservicewebservice请求仍然是一种基本的POST方法,有些方法接受GET 打开WSDL(如果它是MS服务,例如以.asmx结尾),这将显示请求包的示例 ====================================Android 传递参数,android,Android,如何在android中将参数值传递给webservicewebservice请求仍然是一种基本的POST方法,有些方法接受GET 打开WSDL(如果它是MS服务,例如以.asmx结尾),这将显示请求包的示例 ==================================== HTTP POST The following is a sample HTTP POST request and response. The placeholders shown need to be repla
HTTP POST
The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.
POST /webservices/tempconvert.asmx/CelsiusToFahrenheit HTTP/1.1
Host: www.w3schools.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
Celsius=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://tempuri.org/">string</string>
httppost
下面是一个HTTP POST请求和响应示例。显示的占位符需要替换为实际值。
POST/webservices/tempconvert.asmx/CelsiusToFahrenheit HTTP/1.1
主持人:www.w3schools.com
内容类型:application/x-www-form-urlencoded
内容长度:长度
摄氏度=字符串
HTTP/1.1200ok
内容类型:text/xml;字符集=utf-8
内容长度:长度
一串
=================================
HTTP POST
The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.
POST /webservices/tempconvert.asmx/CelsiusToFahrenheit HTTP/1.1
Host: www.w3schools.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
Celsius=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://tempuri.org/">string</string>
标题
POST/webservices/tempconvert.asmx/CelsiusToFahrenheit HTTP/1.1
主持人:www.w3schools.com
内容类型:application/x-www-form-urlencoded
内容长度:长度
身体
串
因此,主体是“string=32”
HttpClient将执行
另见:
你也可以试试KSOAP,但是你可以!能够在一个充满痛苦的世界里,我从未真正与之交过朋友……另一种方法是构建整个soap数据包并发布它。我更喜欢这种方式,好像提供者删除了POST动词,您的代码仍然可以 因此,构建soap数据包(来自上面链接中的asmx示例)并发布它 小提琴手也会在这里帮助你