none
How to test “ASMX Web Service” without “Visual Studio” RRS feed

  • Question

  • I have created "ASMX Web Service" and Published it Successfully. Now, I have to test this web service on some other PC.

    Note: In this PC, there is no Visual Studio, only Framework installed.

    I copied this "Web Service project" to that PC and installed Local IIS. When I browse to ".asmx web service", I am able to navigate to that service, but here is my problem.

    I am not getting "Web Methods" that I have created in my project

    What is gone wrong, please suggest me and tell me.

    Here is my web.config.

    <configuration>
    
    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    
      <webServices>
        <protocols>
          <add name="HttpGet"/>
          <add name="HttpPost"/>
        </protocols>
      </webServices>
    
    </system.web>
    <system.webServer>
        <directoryBrowse enabled="true"/>
    </system.webServer>
    
    </configuration>
    Here is the sample web method:

    [WebMethod]
    public string strart(string empname)
    {
        string name = empname;
        return name;
    }
    
    Any help would be greatly appreciated. Thanks!!

    • Moved by Kristin Xie Wednesday, February 4, 2015 9:48 AM move to appropriate forum
    Tuesday, February 3, 2015 6:00 AM

Answers

  • within the "protocols" section add: 

    <add name="Documentation"/>

    Let us know if it works.


    Fouad Roumieh

    Tuesday, February 3, 2015 7:51 AM
  • Hi,

    For this situation, if you just use web browser browse the service, you can only get the web service description(WSDL).

    If you want to call the web service method, either you could add service reference into your project or try to use the below command to generate the  class, then add the add this file manually to your project.

    wsdl.exe /out:d:/Proxy.cs /order http://localhost:2178/Services.asmx

    Besides, if you want to call the service method directly, you could try to use the WCF Restful service.

    Fristly, create your own WCF Restful service and deploy it to the IIS to host the service.

    Then, you could test the restful service by call the corresponding service method in the browser.

    For more information about WCF Restful service, you could refer to the following links:

    https://msdn.microsoft.com/en-us/magazine/dd315413.aspx

    http://www.codeproject.com/Articles/571813/A-Beginners-Tutorial-on-Creating-WCF-REST-Services

    Regards

    Thursday, February 5, 2015 6:14 AM
    Moderator

All replies