web services - WebService in asp.net using visual studio 2008 -


as know, if build web service using visual studio, visual studio automatically generate 2 files, first 1 .asmx , second 1 .vb code behind.

in code behind(.vb) got :

imports system.web imports system.web.services imports system.web.services.protocols  <webservice(namespace:="http://tempuri.org/")> _ <webservicebinding(conformsto:=wsiprofiles.basicprofile1_1)> _ <global.microsoft.visualbasic.compilerservices.designergenerated()> _ public class webservice  inherits system.web.services.webservice  <webmethod()> _ public function helloworld() string     return "hello world" end function  end class 

and in .asmx file, got :

<%@ webservice language="vb" codebehind="~/app_code/webservice.vb" class="webservice" %> 

the question is

  1. what main purpose of .asmx file? show 1 row code, useful?
  2. can make method .asmx file , not in code_behind? , how consume .aspx file?

yes possible.

refer below links:

why asmx web services have markup file?

<%@ webservice language="c#" class="webservice1" %>  using system.web;       using system.web.services;       [webservice(namespace = "http://tempuri.org/")]     [webservicebinding(conformsto = wsiprofiles.basicprofile1_1)]    [system.componentmodel.toolboxitem(false)]      public class webservice1 : webservice      {          [webmethod]          public string helloworld()        {               return "hello world";        }     }    

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -