【发布时间】:2013-11-12 06:06:57
【问题描述】:
我必须在 asp.net 应用程序和 android 应用程序之间进行通信,以便在桌面应用程序和移动应用程序之间发送和接收数据。我的 asp.net webservices 数据是:
Service1
The following operations are supported. For a formal definition, please review the Service Description.
AddNewResource
AddNewTask
Delete
DeleteTask
DeletedResources
DeletedTasks
GetResourceForEdit
GetResources
GetTaskForEdit
GetTaskList
GetTaskListByResource
RestoreResource
RestoreTask
SetTaskProgress
SetTaskStatus
TaskReport
Update
UpdateTask
This web service is using http://tempuri.org/ as its default namespace.
Recommendation: Change the default namespace before the XML Web service is made public.
而网络服务的细节是:
**AddNewResource**
Test
The test form is only available for requests from the local machine.
SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /ProjectManagementServices/service1.asmx HTTP/1.1
Host: 184.180.25.240
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/AddNewResource"
<?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>
<AddNewResource xmlns="http://tempuri.org/">
<resourceName>string</resourceName>
<resourceEmail>string</resourceEmail>
<backupResource1>string</backupResource1>
<backupResource2>string</backupResource2>
</AddNewResource>
</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>
<AddNewResourceResponse xmlns="http://tempuri.org/">
<AddNewResourceResult>boolean</AddNewResourceResult>
</AddNewResourceResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /DGSProjectManagementws/service1.asmx HTTP/1.1
Host: 184.180.25.240
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>
<AddNewResource xmlns="http://tempuri.org/">
<resourceName>string</resourceName>
<resourceEmail>string</resourceEmail>
<backupResource1>string</backupResource1>
<backupResource2>string</backupResource2>
</AddNewResource>
</soap12:Body>
</soap12:Envelope>
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>
<AddNewResourceResponse xmlns="http://tempuri.org/">
<AddNewResourceResult>boolean</AddNewResourceResult>
</AddNewResourceResponse>
</soap12:Body>
</soap12:Envelope>
如何在 android 中编写 web 服务以在 asp.net 和 android 应用程序之间发送和接收数据。
我有很多谷歌,但没有得到相关的教程和指导。
请指导
【问题讨论】:
-
你可以编写xml脚本并通过ksoap库解析它
-
你能建议我任何关于解析和编写 xml 脚本的教程吗?bcz 我是一名新开发人员。谢谢
-
试试这个教程可能会有帮助Restful API for android
标签: android asp.net web-services client-server ksoap