简体   繁体   English

IIS中的Web服务部署?

[英]Web Service deployment in IIS?

I started learning web services. 我开始学习Web服务。 I learnt about web services, UDDI, WSDL, SOAP etc. and architecture of web services. 我学习了Web服务,UDDI,WSDL,SOAP等以及Web服务的体系结构。 Visual Studio is running the service in local system successfully. Visual Studio正在本地系统中成功运行该服务。

Then I deployed the entire folder of that web service in IIS wwwroot , and tested. 然后我在IIS wwwroot中部署了该Web服务的整个文件夹,并进行了测试。 Its running successfully. 它运行成功。

But when I remove the other file from the wwwroot\\webService1 folder (I left only service1.asmx and bin folder) then also service is running. 但是当我从wwwroot \\ webService1文件夹中删除其他文件时(我只留下了service1.asmxbin文件夹),那么服务也在运行。

Here I see that only two file are used in ruuning the webservice one is .asmx and another one is webService.dll in bin folder. 在这里,我看到只有两个文件用于重新调整web服务,一个是.asmx ,另一个是bin文件夹中的webService.dll

I'm not able to understand where is SOAP, WSDL, namespace or other things, that are required to run web service. 我无法理解运行Web服务所需的SOAP,WSDL,命名空间或其他内容。

Please clarify. 请澄清。

SOAP, WSDL, Namespace are all handled by IIS and ASP.NET. SOAP,WSDL,Namespace都由IIS和ASP.NET处理。 In your scenario, your web service endpoint is your asmx file (no .cs file required in your deployment), and the DLL in the bin folder contains the code that you wrote for your webservice (so it does something). 在您的方案中,您的Web服务端点是您的asmx文件(部署中不需要.cs文件),bin文件夹中的DLL包含您为Web服务编写的代码(因此它可以执行某些操作)。

If you call up your webservice in a web browser, you should see your web methods listed out to test. 如果您在Web浏览器中调用Web服务,则应该看到列出的Web方法以进行测试。 IIS knows how to process *.asmx files to do this. IIS知道如何处理* .asmx文件来执行此操作。 If you click on one, you should see a sample form (if input parameters are expected) and a button. 如果单击一个,您应该看到一个示例表单(如果需要输入参数)和一个按钮。 Again, IIS knows how to serve this out to you. IIS再次知道如何为您服务。 When you click the button, IIS and ASP.NET handle the work of SOAPing your request, handling it with your code, and SOAPing the response back to you. 当您单击该按钮时,IIS和ASP.NET将处理SOAPing您的请求,使用您的代码处理它以及将响应SOAP回复给您的工作。

If you create a "test" project in Visual Studio, and set a web service reference that points to your deployed web service, Visual Studio will create a proxy class and pull in some additional code from it's discovery of the service. 如果在Visual Studio中创建“测试”项目,并设置指向已部署的Web服务的Web服务引用,Visual Studio将创建一个代理类,并从其发现的服务中引入一些其他代码。 Try it. 试试吧。 You should get at least: a WSDL which defines your web service, a file called reference.cs which contains the code that does the heavy lifting of calling your webservice (SOAPing the request from your application and unSOAPing from the response). 您至少应该得到:一个定义Web服务的WSDL,一个名为reference.cs的文件,其中包含调用Web服务的繁重代码(从应用程序中解析请求并从响应中解析)。

If you download a tool called Fiddler, you should be able to intercept and inspect the SOAP call to your web service. 如果您下载了一个名为Fiddler的工具,您应该能够拦截并检查对您的Web服务的SOAP调用。

Take a look at Web Services with ASP.NET for additional information. 有关其他信息,请查看使用ASP.NET的Web服务

There are no such 'files' at all. 根本没有这样的'文件'。 The asmx and dll files contain all of the code for the service. asmxdll文件包含服务的所有代码。 You can see some of that in the URLs that are requested for the SOAP/WSDL info. 您可以在为SOAP / WSDL信息请求的URL中看到其中的一些内容。

I believe if you append ?WSDL after .asmx you will see the definitions. 我相信如果你在.asmx之后附加?WSDL,你会看到定义。 Such as this example: 比如这个例子:

WSDL Example WSDL示例

I think these are protocols and does not require anything. 我认为这些是协议,不需要任何东西。 IIS and the requesting applications understand these protocols. IIS和请求的应用程序了解这些协议。

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

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