使用基于。net的Web服务将SOAP XML转换为JSON

时间:2022-04-30 15:23:02

I am developing an Mobile Web App. I consume a SOAP XML based web service. But based on this thread Why is it not a good idea to use SOAP for communicating with the front end (ie web browser)?, I am planning to use JSON instead of SOAP XML.

我正在开发一个移动Web应用程序,我使用基于SOAP XML的Web服务。但是基于这个线程,为什么使用SOAP与前端(即web浏览器)通信不是一个好主意呢?我打算使用JSON而不是SOAP XML。

Is there any library that will convert a SOAP based XML in to JSON format in .Net?

有什么库可以将基于SOAP的XML转换成。net中的JSON格式吗?

2 个解决方案

#1


1  

Take a look at Json.NET. It is capable of converting JSON to and from XML.

看看Json.NET。它能够将JSON转换为XML和XML。

#2


1  

There's no need to use a separate library to coax JSON out of ASP.NET services, long as you're okay with using POST requests and no GET requests. Here's an example of using jQuery to retrieve JSON from an ASMX service, for exmaple: http://encosia.com/using-jquery-to-consume-aspnet-json-web-services/

不需要使用单独的库从ASP中哄骗JSON。NET服务,只要您可以使用POST请求而不使用GET请求。这里有一个使用jQuery从ASMX服务中检索JSON的示例:http://encosia.com/using-jquer-consu -aspnet- JSON -web-services/

#1


1  

Take a look at Json.NET. It is capable of converting JSON to and from XML.

看看Json.NET。它能够将JSON转换为XML和XML。

#2


1  

There's no need to use a separate library to coax JSON out of ASP.NET services, long as you're okay with using POST requests and no GET requests. Here's an example of using jQuery to retrieve JSON from an ASMX service, for exmaple: http://encosia.com/using-jquery-to-consume-aspnet-json-web-services/

不需要使用单独的库从ASP中哄骗JSON。NET服务,只要您可以使用POST请求而不使用GET请求。这里有一个使用jQuery从ASMX服务中检索JSON的示例:http://encosia.com/using-jquer-consu -aspnet- JSON -web-services/