RESTlet Web服务

编程入门 行业动态 更新时间:2024-10-28 18:33:13
本文介绍了RESTlet Web服务-从ASP.NET调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有人知道等效的ASP.NET C#代码来调用Java RESTlet Web服务吗?这是Java客户端版本:

Does anyone know the equivlent ASP.NET C# code to call a Java RESTlet web service? Here''s the Java Client version:

public static function getRestServiceCall(URL : String, userid : String, password : String) : Response { // Prepare the request Request request = new Request(Method.GET, URL) // Add the client authentication to the call ChallengeScheme scheme = ChallengeScheme.HTTP_BASIC; ChallengeResponse authentication = new ChallengeResponse(scheme, ID, Pwd); request.setChallengeResponse(authentication); // Ask to the HTTP client connector to handle the call Client client = new Client(Protocol.HTTP); Response response = client.handle(request); return response; }

我可以使用HTTPWebRequest进行请求/响应,但是质询/响应让我很烦. .NET中是否有一个相等的调用?

I can request/respond using HTTPWebRequest but the Challenge/Response is throwing me. Is there an equal call in .NET?

推荐答案

如果它是Web服务,那么您可以对其进行引用并调用它的方法,您不需要做所有这一切.这段代码使用的是为该过程编写的类,因此它们必须存在于.NET中才能使用. If it''s a webservice, then you can just make a reference to it and call it''s methods, you shouldn''t need to do all this. This code is using classes written for the process, so they would need to exist in .NET for you to use them.

更多推荐

RESTlet Web服务

本文发布于:2023-10-29 13:30:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1539821.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:RESTlet   Web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!