仅json格式的网络服务响应 [英] webservice response onlyin json format

查看:72
本文介绍了仅json格式的网络服务响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有回应

I have response in

<?xml version="1.0" encoding="utf-8" ?>
  <string xmlns="http://tempuri.org/">[{"sucess":"1","key":"0ce2a19b-cf8e-4b29-89a1-77a336479d7c","password":"ch"}]</string>




我只想要json格式,而不想要xml和字符串.




I want only in json format not xml and string.

推荐答案

问题是什么?
如果服务如此回应您,则您有责任将其剥离并获取所需数据.看来该服务以SOAP格式返回JSON数据(这是非常不正常的).因此,您需要解析XML以获取JSON数据,或者,如果可以调整服务,请使用其他REST端点重新调整JSON数据.
What is the question ???
If the service responds you like this then its your responsibility to strip it down and to get the required data. As it seems the service returns JSON data in SOAP format (which is quite abnormal). So you need to parse the XML to get the JSON data or alternatively if you can shange the service, retun the JSON data with a different REST endpoint.


这篇关于仅json格式的网络服务响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆