Navigation

Friday, June 25, 2010

Calling web service from browser

If you want to access a simple web service via the browser address line you have to add the following to the web.config to enable httpget.

 

 <system.web>
    <webServices>
      <protocols>
        <add name="HttpGet"/>
        <add name="HttpPost"/>
      </protocols>
    </webServices>


</system.web>



Then you can do this;



    <WebMethod()> _
    Public Function GetTime(ByVal pText As String) As String
        Return pText & " " & Now.ToString
    End Function


http://localhost:6722/WebService1.asmx/GetTime?pText=hi

No comments: