在.NET 4.0中引用Web服务 [英] Referring a web service in .NET 4.0

查看:110
本文介绍了在.NET 4.0中引用Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



我自己开发了一个应用程序,并坚持使用一个概念。让我解释整个场景,它将帮助您准确理解我想要的内容。



我在解决方案中有两个项目。其中一个是Web服务,另一个是简单的Web应用程序。 Web应用程序需要引用Web服务。为此,我必须在我的Web应用程序中添加Web服务作为参考。

现在,我无法理解如果我只是添加服务作为参考,那么Web应用程序如何打算进入那个?



有人可以一步一步地帮我解决这个问题吗?请伙计们,我需要帮助



谢谢。

解决方案

如果Web服务框架是WCF和Web应用程序是ASP.NET,然后我已经为此制作了一篇文章。 通过Internet创建连接设备使用的Web服务 [ ^ ]



让我告诉你这是怎么做的,(我会在这是为了网络服务,让我们开始我们现在写客户端)web服务引用需要运行。在我的情况下,它托管在一个控制台项目中,该项目一直在运行,然后我选择了Add Service Reference。这引用了它。完成后,您可以管理Web应用程序以作为该Web服务的客户端。作为客户端,您的Web应用程序将能够向服务器发送请求。



我建议你阅读我提供的文章,或者最好的。您尝试了解WCF如何处理来自其客户端的请求。深入了解事物的运作方式是构建框架的关键。



https ://msdn.microsoft.com/en-us/library/ms733133(v = vs.110).aspx [ ^ ]

https://msdn.microsoft.com/en-us/library/ms734691(v = vs.110)的.aspx [ ^ ]



阅读本文作为一个非常快速和简短的文档: https://msdn.microsoft.com/en-us/library/bb386386.aspx [ ^ ]


完成Tu torial [ ^ ]

Hello All,

I have developing an application by my own and stuck in a concept. Let me explain the whole scenario that will help you understand exactly what I want.

I have two projects in a solution. One of them is a web service and another one is a simple web application. The web application need to refer the web service. For that, I have to add the web service as the reference in my web application.
Now, I cannot be able to understand that if I simply add the service as the reference, then how the web application is going to access that?

Can anybody help me out this whole thing step by step? Please guys, I need help

Thanks.

解决方案

If web service framework is WCF and web application is ASP.NET, then I already have produced an article for that. Creating a Web Service to be consumed by connected Devices via Internet[^]

Let me tell you how that was done, (I would start after "This is up for the web service, let us now write the client") the web service to reference needs to be running. In my case it was hosted in a console project, which was kept running and then I selected Add Service Reference. That references it. Once that has been done, you can manage the web application to work as a client for that web service. As a client, your web application would be able to send requests to the server.

I would recommend that you read the article I provided, or at the best. You try to learn how WCF handles requests from their clients. Having a deep knowledge of how things work is the key to building a framework.

https://msdn.microsoft.com/en-us/library/ms733133(v=vs.110).aspx[^]
https://msdn.microsoft.com/en-us/library/ms734691(v=vs.110).aspx[^]

Read this as a very quick and short documentation: https://msdn.microsoft.com/en-us/library/bb386386.aspx[^]


Complete Tutorial[^]


这篇关于在.NET 4.0中引用Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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