简体   繁体   English

对Web服务的请求(POST)

[英]Request to Web Service (POST)

I'm trying to send a request to my web service that I've created (http://localhost/WebServices/DisplayResolution.asmx?op=Get). 我正在尝试向创建的Web服务发送请求(http://localhost/WebServices/DisplayResolution.asmx?op = Get)。 I believe the web service requires POST to be sent. 我相信该Web服务需要发送POST。

How can I do this from my C# desktop client? 如何从C#桌面客户端执行此操作? Should I use SOAP as the web service recommends?! 我应该按照Web服务的建议使用SOAP吗?

Image 图片

You may want to use Visual Studio to create a the necessary proxy classes to consume your web service by adding a "Service reference" to your client project. 您可能想使用Visual Studio通过向客户端项目添加“服务引用”来创建必要的代理类以使用Web服务。

This article on Consuming Web (asmx) Services might help. 有关使用Web(asmx)服务的本文可能会有所帮助。

You can use WebClient class to make this call. 您可以使用WebClient类进行此调用。

Also since this SOAP web service there is nothing to stop you from creating web reference of this web service in to your applicaiton and use the proxy class. 同样,由于此SOAP Web服务没有什么可以阻止您在您的应用程序中创建此Web服务的Web引用并使用代理类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM