Пример #1
0
        public static string GetDeviceId(WSD.ByeType bye)
        {
            string id = string.Empty;

            if ((bye != null) &&
                (bye.EndpointReference != null) &&
                (bye.EndpointReference.Address != null))
            {
                id = bye.EndpointReference.Address.Value;
            }
            return(id);
        }
Пример #2
0
        public void SendBye()
        {
            WSD.ByeType             bye        = new WSD.ByeType();
            XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();

            namespaces.Add("dn", DiscoveryUtils.ONVIF_NETWORK_WSDL_URL);
            namespaces.Add("dn", DiscoveryUtils.ONVIF_NETWORK_WSDL_URL);
            bye.EndpointReference               = new WSD.EndpointReferenceType();
            bye.EndpointReference.Address       = new WSD.AttributedURI();
            bye.EndpointReference.Address.Value = _uuid;
            bye.Types       = "dn:NetworkVideoTransmitter";
            bye.Scopes      = new WSD.ScopesType();
            bye.Scopes.Text = _scopes;
            bye.XAddrs      = ServiceAddress;

            byte[] data = SoapBuilder.BuildMessage(bye, Encoding.UTF8, new DiscoveryHeaderBuilder(), namespaces);
            Send(data);
        }
Пример #3
0
        public byte[] BuildBye(string[] scopes, string types, XmlQualifiedName[] typesNamespaces, string[] xAddrs, uint metadataVersion)
        {
            WSD.ByeType bye = new WSD.ByeType();

            // Scopes
            bye.Scopes = BuildScopes(scopes, null);

            // Types
            bye.Types = types;

            // EndpointReference
            bye.EndpointReference = BuildEndpointReference();

            // XAddrs
            bye.XAddrs = BuildXAddrs(xAddrs);

            // MetadataVersion
            bye.MetadataVersion = metadataVersion;

            byte[] msg = SoapBuilder.BuildMessage(
                bye, Encoding.UTF8, new DiscoveryHeaderBuilder(), new XmlSerializerNamespaces(typesNamespaces));

            return(msg);
        }