Skip to content

could you explain how to get OnvifEvents #1

@dotori1995-enu

Description

@dotori1995-enu

I don’t know what to say for your contribution!
i learn about the onvif interface, and maked onvif PTZ function.

but i encounter the new big deal.

        public void pull(string ip, int port)
        {
             ....
             ....

            // 2. CreatePullPointSubscription
            FilterType filter = new FilterType();
            DateTime currentTime;
            XmlElement[] xml = null;
            DateTime? termTime;
            List<MessageHeader> lstHeaders = new List<MessageHeader>() { };

            EndpointReferenceType ert = eptc.CreatePullPointSubscription(
                filter,
                "PT15S",
                new CreatePullPointSubscriptionSubscriptionPolicy(),
                ref xml,
                out currentTime,
                out termTime
                );
            listBox1.Items.Add(ert.Address.Value);

            //PROBLEM HERE "ReferenceParameters" IS NULL
            if ((ert.ReferenceParameters != null) && (ert.ReferenceParameters.Any != null))
            {
                foreach (System.Xml.XmlElement oXml in ert.ReferenceParameters.Any)
                {
                    string strName = oXml.LocalName;
                    string strNS = oXml.NamespaceURI;
                    string strValue = oXml.InnerXml;

                    lstHeaders.Add(MessageHeader.CreateHeader(strName, strNS, strValue, true));
                }
            }

i always get that "ReferenceParameters" is null.

image

could you explain what happen in this code?


OS: window10
develop framework: dotnet framwork 4.8
IDE: visual studio 2022

Thanks for reading

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions