title: Testing a web service by returning a string of data in a web application form
body: <p>I've got a web service but need to know how to test it in a windows application form.</p>
  
  <p>here is the start of the service. Would I put the form code inside a button, or just return it in a label? Not exactly overly clued into c# or .net I've called the web service succesfully thougha nd just need to return the string to make sure encryption is working.</p>
  
  <pre><code>&lt;%@ WebService Language="C#" Class="UserEncryptionLink.EncryptUserLink" %&gt;
  
  
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Services;
  using System.Web.Services.Protocols;
  using System.Xml;
  using System.Xml.XPath;
  using System.Xml.Schema;
  using System.Xml.Serialization;
  using System.Text;
  using System.Security.Cryptography;
  
  
  
  
  namespace UserEncryptionLink
  {
  /// &lt;summary&gt;
     /// This Web Service is to encrypt user details and display them in the URL when  they   click on a link taking them to InfoExchange
  /// &lt;/summary&gt;
  [WebService(Namespace = " Webspace name")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  [System.ComponentModel.ToolboxItem(false)]
  //To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the    following line. 
  [System.Web.Script.Services.ScriptService]
  
  
  
  
  
  
  
  public class EncryptUserLink : System.Web.Services.WebService
  {
  [WebMethod]
  public void TestCypher()
  {
      var key = "12345";
      var vector = "12345";
      var username = "YOURDOMAIN\\YOURUSERNAME";
      var url = "sitename.com";
      var it = GetSingleSignOnUrl(url, username, key, vector);
  }
  </code></pre>
  
  <p>And my form</p>
  
  <p>Yeah I've got my form referencing the service, it looks like this.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using FormForEncrypt.nameofURL;
  using System.Net;
  
  
  
  namespace FormForEncrypt
  {
  
  
  public partial class EncryptForm : Form
  {
  
  
      public EncryptForm()
      {
          InitializeComponent();
  
  
      }
  
      // creates an instance of the web service as a member of the class, will put it down below, doesn't seem to work though declared in the using statement
      private nameofURL.EncryptUserLink userform = new nameofUrl.EncryptUserLink();
  
  
  
      [System.Web.Services.WebMethod]
  
      private void testButton_Click_1(object sender, EventArgs e)
  
      {
          //method to send on button click, then recieve the string to show it works, it should come out as http://CLIENTNAME.info-exchange.com/yyyyMMddHHmmssDomainUsername 
  
          //create instances of the details
  
  
          string[] it;
  
          //send string
  
          //recieve string and display, it must display the same as what was sent. 
  
  
      }
  }
  </code></pre>
  
  <p>}</p>