在C#中使用JSON网站 [英] CONSUME A JSON WEBSERVICES IN C#

查看:111
本文介绍了在C#中使用JSON网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
我已经在互联网上获取了任何json网络服务链接并添加了网络引用,请输入该json网络服务链接并输入,但它不会出现...
如果有人知道请让我知道如何在C#中使用JSON Web服务

hi to all.
i have taken any json web service link in internet and add web reference ,enter that json web service link and enter but its not coming...
if any body knows pls let me know HOW TO CONSUME JSON WEBSERVICES IN C#

推荐答案

komalilella,

即使您针对此问题发布了多个问题,解决方案也将与我之前为以下问题提供的解决方案相同.

如何在Web服务下使用和使用在c# [ ^ ]

正如您在之前的问题和问题"的注释"部分中提到的那样,您正尝试在Service Url以下使用.

[http://api.geonames.org/citiesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&lang=de&username=demo]

实际上,您正在尝试使用基于REST的服务而不是Web服务.

您可以参考为您先前的问题提供的我的解决方案来解决您的问题.
komalilella,

Even if you post multiple questions for this Problem, Solution will remain the same as I given for your earlier below Question.

how to use below web service and consume in c#[^]

As you mentioned in your earlier question and in Comments section of this question, you are trying to consume below Service Url.

[http://api.geonames.org/citiesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&lang=de&username=demo]

Actully you are trying to consume REST based service and not the Web Service.

You may refer my solution provided for your earlier question to solve your problem.


您好,

您可以像这样

例如,我有一个Web服务名称Test.jsonWS,并且我想访问其名为Start()
的类Print()方法.
Hi,

You can do this like this

for eg i have a webservice name Test.jsonWS,and i want to access its class Print() method named Start()
Test.jsonWS.Print.Start()



并像这样访问位于Web上的Web服务



and accessing web service located on web like this

Test.WebService_Test_Process objUP = new Test.WebService_Test_Process();



其中Test是Web服务的名称



where Test is the name of web service


这篇关于在C#中使用JSON网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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