如何在android中解析soap响应数据

时间:2014-04-04 06:51:37

标签: java android xml wcf

我从android.i调用了wcf webservice,得到了响应字符串。

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body><ProcessResponse xmlns="http://venture-easy.com/Core/ServiceManager">
<ProcessResult xmlns:a="http://venture-easy.com/Core/BaseResponse" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:BaseResponse i:type="b:LoginResponse" xmlns:b="http://venture-easy.com/Security/LoginResponse">
<a:IsSuccess>false</a:IsSuccess>
<a:OffSetMinutes>0</a:OffSetMinutes>
<a:TimeTrace xmlns:c="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<c:string>StartProxy 04/01/2014 04:36:24.405 PM</c:string>
<c:string>StartServiceHandle04/03/2014 09:37:00.049 PM</c:string>
<c:string>StartBaseHandle04/03/2014 09:37:00.068 PM</c:string>
<c:string>EndHandle4/3/2014 9:37:03 PM</c:string>
<c:string>EndBaseHandle04/03/2014 09:37:03.015 PM</c:string>
<c:string>EndServiceHandle04/03/2014 09:37:03.015 PM</c:string>
</a:TimeTrace><a:result>Error</a:result>
<b:Account i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Core.Model"/>
<b:Bookmark i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Core.SystemService.Model"/>
<b:ContractDetail i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Booking.Model"/>
<b:DefaultView i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Core.Model"/>
<b:IsAccountActivated>false</b:IsAccountActivated>
<b:IsAgreementAccepted>0</b:IsAgreementAccepted>
<b:IsAuthorizedForMobileAccess>false</b:IsAuthorizedForMobileAccess>
<b:IsCorporateContracts>false</b:IsCorporateContracts>
<b:IsPasswordExpired>false</b:IsPasswordExpired>
<b:IsPasswordReset>false</b:IsPasswordReset>
<b:IsUserActivated>false</b:IsUserActivated>
<b:IsValidUser>false</b:IsValidUser>
<b:MaxTaxiCompanyTieUp>0</b:MaxTaxiCompanyTieUp>
<b:Menus i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Core.Model"/>
<b:Module i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Core.SystemService.Model"/>
<b:ParentAccount i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Core.Model"/>
<b:SessionId i:nil="true"/>
<b:SubMenus i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Core.Model"/>
<b:UserContext i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Core.Model"/>
<b:UserModule i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Core.SystemService.Model"/>
<b:Views i:nil="true" xmlns:c="http://schemas.datacontract.org/2004/07/PlexiTech.Application.Entity.Core.Model"/>
</a:BaseResponse>
</ProcessResult>
</ProcessResponse>
</s:Body>
</s:Envelope>

我正在使用httppost调用调用wcf并获取类似于此的字符串响应。请告诉我如何在android.i中解析此响应。这是一种新的解析方式。请告诉我它非常紧急。谢谢提前。

1 个答案:

答案 0 :(得分:0)