Søk i hjelpesidene:
Printer friendly version

Using E-Site SITE.ASMX Web service in Visual studio 2008

Add service reference

Create a new project, right click the project and choose add service reference. See picture below:

Add service reference

Enter your service url and click "Go"

Your service url is your site url + /site.asmx
See picture below:

Enter your service url and click

Change the namespace to something more logical, such as ESite. Click OK

Write code to use the client

See a very simple C# Example Below

private void button1_Click(object sender, EventArgs e)
   // Create a new soap client
   var s = new ESite.SiteSoapClient();

   // Get list of items in folder object with id 1040 (This MUST be changed with an actual ID for a folder within your site)
   var result = s.BrowseChildren("username", "pass", 1040);    // Iterate all items in result
   foreach (var item in result)
      textBox1.Text += item.Heading; // Just for testing       // Get all field values for this object
      var allFields = s.GetFields("username", "pass", item.ObjectID);       // Iterate the list
      foreach (var fieldvalue in allFields)
         textBox1.Text += fieldvalue.Field + " = " + fieldvalue.Value;        }