Example #1
0
        // Constructor sets service properties and adds event sources
        public EventingService(ProtocolVersion version) : base(version)
        {
            // Add ServiceNamespace. Set ServiceID and ServiceTypeName
            ServiceNamespace = new WsXmlNamespace("evnt", "http://schemas.example.org/EventingService");
            ServiceID        = "urn:uuid:3cb0d1ba-cc3a-46ce-b416-212ac2419b91";
            ServiceTypeName  = "EventingService";

            // Add event sources
            EventSources.Add(new DpwsWseEventSource("evnt", "http://schemas.example.org/EventingService", "SimpleEvent"));
            EventSources.Add(new DpwsWseEventSource("evnt", "http://schemas.example.org/EventingService", "IntegerEvent"));
            this.AddEventServices();

            // Start the event simulator
            StartEventSimulator();
        }
        public EventingService(ProtocolVersion version) :
            base(version)
        {
            // Set base service properties
            ServiceNamespace = new WsXmlNamespace("eve", "http://schemas.example.org/EventingService");
            ServiceID        = "urn:uuid:cd35d6ba-3e2f-440b-bc2f-b7c375dc6536";
            ServiceTypeName  = "EventingService";

            // Add service types here

            // Add event sources here
            EventSources.Add(new DpwsWseEventSource("eve", "http://schemas.example.org/EventingService", "SimpleEvent"));
            EventSources.Add(new DpwsWseEventSource("eve", "http://schemas.example.org/EventingService", "IntegerEvent"));
            this.AddEventServices();
        }
Example #3
0
        // Constructor sets service properties and defines operations and adds event sources
        public SimpleService(ProtocolVersion version) : base(version)
        {
            // Add ServiceNamespace. Set ServiceID and ServiceTypeName
            ServiceNamespace = new WsXmlNamespace("sim", "http://schemas.example.org/SimpleService");
            ServiceID        = "urn:uuid:3cb0d1ba-cc3a-46ce-b416-212ac2419b90";
            ServiceTypeName  = "SimpleService";

            // Add service operations
            ServiceOperations.Add(new WsServiceOperation("http://schemas.example.org/SimpleService", "OneWay"));
            ServiceOperations.Add(new WsServiceOperation("http://schemas.example.org/SimpleService", "TwoWayRequest"));

            // Add event sources
            DpwsWseEventSource SimpleEvent = new DpwsWseEventSource("sim", "http://schemas.example.org/EventingService", "SimpleEvent");

            EventSources.Add(SimpleEvent);
            this.AddEventServices();
        }
Example #4
0
        public TestService(string guid, ProtocolVersion version) : base(version)
        {
            // Add ServiceNamespace. Set ServiceID and ServiceTypeName
            ServiceNamespace = new WsXmlNamespace("sim", "http://schemas.example.org/SimpleService");
            ServiceID        = "urn:uuid:" + guid;
            ServiceTypeName  = "TestService";

            // Add additional namesapces if needed
            // example: Namespaces.Add("someprefix", "http://some/Namespace");

            // Add service operations
            ServiceOperations.Add(new WsServiceOperation("http://schemas.example.org/SimpleService", "OneWay"));
            ServiceOperations.Add(new WsServiceOperation("http://schemas.example.org/SimpleService", "TwoWayRequest"));

            // Add event sources
            DpwsWseEventSource SimpleEvent = new DpwsWseEventSource("sim", "http://schemas.example.org/EventingService", "SimpleEvent");

            EventSources.Add(SimpleEvent);
            this.AddEventServices();
        }