title: Access WebService WebMethod from its URL
body: <p>i have this .asmx class:</p>
  
  <pre><code>    public class WebService1 : System.Web.Services.WebService {
      [WebMethod]
      [ScriptMethod(UseHttpGet = true)] 
          public int IsUserAuthorized(String userId, String appId) {
  
                 //returns an int
         }
      }
  </code></pre>
  
  <p>I have the URL where its published : <a href="http://soporteapps:100/ControlCenter.asmx" rel="nofollow">http://soporteapps:100/ControlCenter.asmx</a> (Only works in my jobs LAN)</p>
  
  <p>Then i have an aspx.cs class where i want to display the int that IsUserAuthorized returns:</p>
  
  <pre><code>   protected void btnAuth_Click(object sender, EventArgs e) {           
          String yo = "jcarbajale001";
          String ControlCenter = "4D91B8BF-9D0E-4322-972D-89CC67EC9995";
  
  
          ControlCenter.WebService1 service = new WebService1();
          int result = service.IsUserAuthorized(yo, ControlCenter);
  
          txtBoxWebService.Text = result.ToString();
      }
  </code></pre>
  
  <p>This works but its not accesing the URL of the webpage. Its just calling the class and its method, how can i do the same but accesing to the URL of the asmx.</p>