Example #1
0
    public System.Single Add(System.Single xValue, System.Single yValue)
    {
// <Snippet2>
        SoapHeaderCollection mySoapHeaderCollection = new SoapHeaderCollection();
        MySoapHeader         mySoapHeader;

        mySoapHeader      = new MySoapHeader();
        mySoapHeader.text = "This is the first SOAP header";
        mySoapHeaderCollection.Add(mySoapHeader);
// </Snippet2>
// <Snippet3>
        mySoapHeader      = new MySoapHeader();
        mySoapHeader.text = "This is the second SOAP header";
        mySoapHeaderCollection.Add(mySoapHeader);
// </Snippet3>
// <Snippet4>
        mySoapHeader      = new MySoapHeader();
        mySoapHeader.text = "This header is inserted before the first header";
        mySoapHeaderCollection.Insert(0, mySoapHeader);
// </Snippet4>
// <Snippet5>
        mySoapHeaders = new MySoapHeader[mySoapHeaderCollection.Count];
        mySoapHeaderCollection.CopyTo(mySoapHeaders, 0);
// </Snippet5>
        object[] results = this.Invoke("Add",
                                       new object[] { xValue, yValue });
        return((System.Single)(results[0]));
    }
Example #2
0
        public static void Check(SoapHeaderCollection headers)
        {
            string wsu = ConfigurationSettings.AppSettings["wsu"];

            if (wsu != "true")
            {
                return;
            }

            bool authorized = false;

            foreach (SoapHeader header in headers)
            {
                SoapUnknownHeader unknown = header as SoapUnknownHeader;
                if (unknown != null)
                {
                    if (unknown.Element.LocalName == "Security" &&
                        unknown.Element.NamespaceURI == "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")
                    {
                        authorized = true;
                    }
                }
            }

            if (!authorized)
            {
                SoapFaultSubCode subCode  = new SoapFaultSubCode(new XmlQualifiedName("SenderNotAuthorized", "http://www.onvif.org/ver10/error"));
                SoapFaultSubCode subCode1 = new SoapFaultSubCode(new XmlQualifiedName("NotAuthorized", "http://www.onvif.org/ver10/error"), subCode);
                throw new SoapException("AccessDenied", new XmlQualifiedName("Sender", "http://www.w3.org/2003/05/soap-envelope"), subCode1);
            }
        }
    public System.Single Add(System.Single xValue, System.Single yValue)
    {
        SoapHeaderCollection mySoapHeaderCollection = new SoapHeaderCollection();
        MySoapHeader         myFirstSoapHeader;

        myFirstSoapHeader      = new MySoapHeader();
        myFirstSoapHeader.Text = "This is the first soap header";
        mySoapHeaderCollection.Add(myFirstSoapHeader);

        MySoapHeader mySecondSoapHeader = new MySoapHeader();

        mySecondSoapHeader.Text = "This is the second soap header";
        mySoapHeaderCollection.Add(mySecondSoapHeader);
// <Snippet1>
        // Check to see whether the collection contains mySecondSoapHeader.
        if (mySoapHeaderCollection.Contains(mySecondSoapHeader))
        {
            // Get the index of mySecondSoapHeader from the collection.
            Console.WriteLine("Index of mySecondSoapHeader: " +
                              mySoapHeaderCollection.IndexOf(mySecondSoapHeader));

            // Get the SoapHeader from the collection.
            MySoapHeader mySoapHeader1 = (MySoapHeader)mySoapHeaderCollection
                                         [mySoapHeaderCollection.IndexOf(mySecondSoapHeader)];
            Console.WriteLine("SoapHeader retrieved from the collection: "
                              + mySoapHeader1);

            // Remove a SoapHeader from the collection.
            mySoapHeaderCollection.Remove(mySoapHeader1);
            Console.WriteLine("Number of items after removal: {0}",
                              mySoapHeaderCollection.Count);
        }
        else
        {
            Console.WriteLine(
                "mySoapHeaderCollection does not contain mySecondSoapHeader.");
        }
// </Snippet1>

        mySoapHeaders = new MySoapHeader[mySoapHeaderCollection.Count];
        mySoapHeaderCollection.CopyTo(mySoapHeaders, 0);
        object[] results = this.Invoke("Add", new object[] {
            xValue,
            yValue
        });
        return((System.Single)(results[0]));
    }
Example #4
0
 // Methods
 public string ReadHeaders(System.Xml.XmlReader reader, System.Xml.Serialization.XmlSerializer serializer, SoapHeaderCollection headers, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, string envelopeNS, string encodingStyle, bool checkRequiredHeaders)
 {
 }
Example #5
0
 public static void EnsureHeadersUnderstood(SoapHeaderCollection headers)
 {
 }
Example #6
0
 public static void GetHeaderMembers(SoapHeaderCollection headers, object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, bool client)
 {
 }
Example #7
0
 public static void WriteUnknownHeaders(System.Xml.XmlWriter writer, SoapHeaderCollection headers, string envelopeNS)
 {
 }
Example #8
0
 public static void WriteHeaders(System.Xml.XmlWriter writer, System.Xml.Serialization.XmlSerializer serializer, SoapHeaderCollection headers, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, bool isEncoded, string defaultNS, bool serviceDefaultIsEncoded, string envelopeNS)
 {
 }
 // Methods
 public string ReadHeaders(System.Xml.XmlReader reader, System.Xml.Serialization.XmlSerializer serializer, SoapHeaderCollection headers, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, string envelopeNS, string encodingStyle, bool checkRequiredHeaders)
 {
 }
 public static void WriteUnknownHeaders(System.Xml.XmlWriter writer, SoapHeaderCollection headers, string envelopeNS)
 {
 }
 public static void WriteHeaders(System.Xml.XmlWriter writer, System.Xml.Serialization.XmlSerializer serializer, SoapHeaderCollection headers, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, bool isEncoded, string defaultNS, bool serviceDefaultIsEncoded, string envelopeNS)
 {
 }
 public static void SetHeaderMembers(SoapHeaderCollection headers, object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, bool client)
 {
 }
 public static void EnsureHeadersUnderstood(SoapHeaderCollection headers)
 {
 }