about us      downloads      documentation      contact      home 
 products
 antHR
 workflow studio
 technical toolkits
 content entry
 workflow
 security
 hierarchy
 concepts
 how tos
 reference
 FAQs
previous: Summary  next: Define web service

How to: Web service actions - Create web service

  Step 1 : Summary
  Step 2 : Create web service
  Step 3 : Define web service
  Step 4 : Setup workflow
  Step 5 : Add to workflow
  Step 6 : Test workflow

We will create a new web service which will be used in the following steps - (page 2 of 6)

Level: developer
Required reading: Simple workflow

We will build a new web service in .net, though any other language (eg Java) may be used. More details instructions for creating a web service can be found in the Microsoft documentation. In this step I will provide the source code.

The web service defines a single method called GetInformation which takes a string parameter and returns a string.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;

namespace WorkflowWebServices
{
    /// <summary>
    /// Summary description for Test.
    /// </summary>
    [WebService(Namespace="http://antorg.com/workflowwebservices")]
    public class Test : System.Web.Services.WebService
    {
        public Test()
        {
            //CODEGEN: This call is required by the ASP.NET Web Services Designer
            InitializeComponent();
        }

        #region Component Designer generated code
        
        //Required by the Web Services Designer 
        private IContainer components = null;
                
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if(disposing && components != null)
            {
                components.Dispose();
            }
            base.Dispose(disposing);        
        }
        
        #endregion

        #region TaskInformationWebService Members
        [WebMethod]
        public string GetInformation(long workflowInstance, string activityName, string parameter)
        {
            return "Hello world: "+parameter;
        }
        #endregion
    }
}        


 

Did you find this article helpful? Comments on this page are welcome and can only help us improve the quality of our documentation.
© Ant Organisation Ltd, 2003