简体   繁体   English

在没有Visual Studio的情况下调用ASMX Web服务

[英]Invoke ASMX Web Service without Visual Studio

There are two PCs: In PC1, I have created ASMX Web Service and Hosted in local IIS. 有两台PC:在PC1中,我创建了ASMX Web Service,并在本地IIS中托管。

My URL is like 我的网址就像

XXX.XXX.X.103:82/WebService.asmx

Now, there is no Visual Studio in PC2, I just installed Framework 4.5. 现在,没有Visual Studio中的PC2,我刚安装框架4.5。

How do I invoke and test that ASMX Web Service using only Framework? 如何调用和测试ASMX Web Service只使用框架?

Because when I run that URL in browser, I got the list of Services but not able to test it. 因为当我在浏览器中运行该URL时,我得到了服务列表,但无法对其进行测试。 How to solve with using only ".NET Framework"? 如何仅使用“ .NET Framework”解决?

Here is the screen shot: 这是屏幕截图:

在此处输入图片说明

I am not getting this "Test Method" in PC2 and "Invoke Button". 我在PC2和“调用按钮”中没有得到此“测试方法”。

Ok, I got the answer: 好吧,我得到了答案:

Here is the code that I added in " Web.Config ". 这是我在“ Web.Config ”中添加的代码。

<webServices>
    <protocols>
      <add name="HttpGet"/>
      <add name="HttpPost"/>
    </protocols>
 </webServices>

如果您要测试的Web服务方法的输入上有任何nullable参数,则不会显示“ Invoke按钮。

ASMX services are designed to run in IIS. ASMX服务旨在在IIS中运行。 When using Visual Studio, a light weight IIS ( Cassini ) is used. 使用Visual Studio时,将使用轻量级的IIS( Cassini )。

You will need to install IIS onto PC2. 您将需要在PC2上安装IIS。

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

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