SoapHeaderCollection Klass

Definition

Innehåller en samling instanser av SoapHeader klassen.

public ref class SoapHeaderCollection : System::Collections::CollectionBase
public class SoapHeaderCollection : System.Collections.CollectionBase
type SoapHeaderCollection = class
    inherit CollectionBase
Public Class SoapHeaderCollection
Inherits CollectionBase
Arv
SoapHeaderCollection

Exempel

[System::Web::Services::WebServiceBindingAttribute(Name="MathSvcSoap",
   Namespace="http://tempuri.org/")]
public ref class MathSvc: public System::Web::Services::Protocols::SoapHttpClientProtocol
{
public:
   array<SoapHeader^>^ mySoapHeaders;

   [SoapHeaderAttribute("mySoapHeaders",
      Direction=SoapHeaderDirection::In)]
   [System::Web::Services::Protocols::SoapDocumentMethodAttribute(
      "http://tempuri.org/Add",
      Use=System::Web::Services::Description::SoapBindingUse::Literal,
      ParameterStyle=System::Web::Services::Protocols::SoapParameterStyle::Wrapped)]
   [MySoapExtensionAttribute]
   Single Add( Single xValue, Single yValue )
   {
      SoapHeaderCollection^ mySoapHeaderCollection = gcnew SoapHeaderCollection;
      MySoapHeader^ mySoapHeader;
      mySoapHeader = gcnew MySoapHeader;
      mySoapHeader->text = "This is the first SOAP header";
      mySoapHeaderCollection->Add( mySoapHeader );

      mySoapHeader = gcnew MySoapHeader;
      mySoapHeader->text = "This is the second SOAP header";
      mySoapHeaderCollection->Add( mySoapHeader );

      mySoapHeader = gcnew MySoapHeader;
      mySoapHeader->text = "This header is inserted before the first header";
      mySoapHeaderCollection->Insert( 0, mySoapHeader );

      mySoapHeaders = gcnew array<MySoapHeader^>(mySoapHeaderCollection->Count);
      mySoapHeaderCollection->CopyTo( mySoapHeaders, 0 );

      array<Object^>^ temp0 = {xValue,yValue};
      array<Object^>^ results = this->Invoke( "Add", temp0 );
      return ( (Single)( results[ 0 ] ) );
   }

   [System::Diagnostics::DebuggerStepThroughAttribute]
   MathSvc()
   {
      this->Url = "http://localhost/MathSvc_SoapHeaderCollection.cs.asmx";
   }

   System::IAsyncResult^ BeginAdd( Single xValue,
      Single yValue, System::AsyncCallback^ callback, Object^ asyncState )
   {
      array<Object^>^ temp1 = {xValue,yValue};
      return this->BeginInvoke( "Add", temp1, callback, asyncState );
   }

   Single EndAdd( System::IAsyncResult^ asyncResult )
   {
      array<Object^>^ results = this->EndInvoke( asyncResult );
      return ( (Single)( results[ 0 ] ) );
   }
};
[System.Web.Services.WebServiceBindingAttribute(Name="MathSvcSoap",
   Namespace="http://tempuri.org/")]
public class MathSvc : System.Web.Services.Protocols.SoapHttpClientProtocol
{
   public SoapHeader[] mySoapHeaders;

   [SoapHeaderAttribute("mySoapHeaders",
      Direction=SoapHeaderDirection.In)]
   [System.Web.Services.Protocols.SoapDocumentMethodAttribute(
      "http://tempuri.org/Add",
      Use=System.Web.Services.Description.SoapBindingUse.Literal,
      ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
   [MySoapExtensionAttribute()]
   public System.Single Add(System.Single xValue, System.Single yValue)
   {
      SoapHeaderCollection mySoapHeaderCollection = new SoapHeaderCollection();
      MySoapHeader mySoapHeader;
      mySoapHeader = new MySoapHeader();
      mySoapHeader.text = "This is the first SOAP header";
      mySoapHeaderCollection.Add(mySoapHeader);
      mySoapHeader = new MySoapHeader();
      mySoapHeader.text = "This is the second SOAP header";
      mySoapHeaderCollection.Add(mySoapHeader);
      mySoapHeader = new MySoapHeader();
      mySoapHeader.text = "This header is inserted before the first header";
      mySoapHeaderCollection.Insert(0, mySoapHeader);
      mySoapHeaders = new MySoapHeader[mySoapHeaderCollection.Count];
      mySoapHeaderCollection.CopyTo(mySoapHeaders, 0);
      object[] results = this.Invoke("Add",
         new object[] {xValue, yValue});
      return ((System.Single)(results[0]));
   }

   [System.Diagnostics.DebuggerStepThroughAttribute()]
   public MathSvc()
   {
      this.Url = "http://localhost/MathSvc_SoapHeaderCollection.cs.asmx";
   }

   public System.IAsyncResult BeginAdd(System.Single xValue,
      System.Single yValue, System.AsyncCallback callback, object asyncState)
   {
      return this.BeginInvoke("Add", new object[] {xValue, yValue},
         callback, asyncState);
   }

   public System.Single EndAdd(System.IAsyncResult asyncResult)
   {
      object[] results = this.EndInvoke(asyncResult);
      return ((System.Single)(results[0]));
   }
}
<System.Web.Services.WebServiceBindingAttribute(Name := "MathSvcSoap", _
    Namespace := "http://tempuri.org/")>  _
Public Class MathSvc
   Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
   Public mySoapHeaders() As SoapHeader

   <SoapHeaderAttribute("mySoapHeaders", _
      Direction := SoapHeaderDirection.In), _
   System.Web.Services.Protocols.SoapDocumentMethodAttribute( _
      "http://tempuri.org/Add", _
      Use := System.Web.Services.Description.SoapBindingUse.Literal, _
      ParameterStyle := System.Web.Services.Protocols.SoapParameterStyle.Wrapped), _
   MySoapExtensionAttribute()>  _
   Public Function Add(xValue As System.Single, yValue As System.Single) _
      As System.Single
      Dim mySoapHeaderCollection As New SoapHeaderCollection()
      Dim mySoapHeader As MySoapHeader
      mySoapHeader = New MySoapHeader()
      mySoapHeader.text = "This is the first SOAP header"
      mySoapHeaderCollection.Add(mySoapHeader)
      mySoapHeader = New MySoapHeader()
      mySoapHeader.text = "This is the second SOAP header"
      mySoapHeaderCollection.Add(mySoapHeader)
      mySoapHeader = New MySoapHeader()
      mySoapHeader.text = "This header is inserted before the first header"
      mySoapHeaderCollection.Insert(0, mySoapHeader)
      mySoapHeaders = New MySoapHeader(mySoapHeaderCollection.Count-1) {}
      mySoapHeaderCollection.CopyTo(mySoapHeaders, 0)
      Dim results() As Object = _
         Me.Invoke("Add", New Object() {xValue, yValue})
      Return CType(results(0), System.Single)
   End Function 'Add

   <System.Diagnostics.DebuggerStepThroughAttribute()>  _
   Public Sub New()
      Me.Url = "http://localhost/MathSvc_SoapHeaderCollection.vb.asmx"
   End Sub

   Public Function BeginAdd(xValue As System.Single, yValue As System.Single, _
      callback As System.AsyncCallback, asyncState As Object) _
      As System.IAsyncResult
      Return Me.BeginInvoke("Add", New Object() {xValue, yValue}, _
         callback, asyncState)
   End Function 'BeginAdd

   Public Function EndAdd(asyncResult As System.IAsyncResult) As System.Single
      Dim results As Object() = Me.EndInvoke(asyncResult)
      Return CType(results(0), System.Single)
   End Function 'EndAdd
End Class

Konstruktorer

Name Description
SoapHeaderCollection()

Initierar en ny instans av SoapHeaderCollection klassen.

Egenskaper

Name Description
Capacity

Hämtar eller anger antalet element som CollectionBase kan innehålla.

(Ärvd från CollectionBase)
Count

Hämtar antalet element som finns i instansen CollectionBase . Den här egenskapen kan inte åsidosättas.

(Ärvd från CollectionBase)
InnerList

Hämtar en ArrayList lista med element i instansen CollectionBase .

(Ärvd från CollectionBase)
Item[Int32]

Hämtar eller anger SoapHeader vid det angivna indexet för SoapHeaderCollection.

List

Hämtar en IList lista med element i instansen CollectionBase .

(Ärvd från CollectionBase)

Metoder

Name Description
Add(SoapHeader)

Lägger till en SoapHeader i SoapHeaderCollection.

Clear()

Tar bort alla objekt från instansen CollectionBase . Den här metoden kan inte åsidosättas.

(Ärvd från CollectionBase)
Contains(SoapHeader)

Avgör om innehåller SoapHeaderCollection en specifik SoapHeader.

CopyTo(SoapHeader[], Int32)

Kopierar elementen i SoapHeaderCollection till en Array, med början vid ett visst index för Array.

Equals(Object)

Avgör om det angivna objektet är lika med det aktuella objektet.

(Ärvd från Object)
GetEnumerator()

Returnerar en uppräkning som itererar genom instansen CollectionBase .

(Ärvd från CollectionBase)
GetHashCode()

Fungerar som standard-hash-funktion.

(Ärvd från Object)
GetType()

Hämtar den aktuella instansen Type .

(Ärvd från Object)
IndexOf(SoapHeader)

Avgör indexet för SoapHeader i .SoapHeaderCollection

Insert(Int32, SoapHeader)

Infogar en SoapHeader i SoapHeaderCollection vid det angivna indexet.

MemberwiseClone()

Skapar en ytlig kopia av den aktuella Object.

(Ärvd från Object)
OnClear()

Utför ytterligare anpassade processer när du rensar innehållet i instansen CollectionBase .

(Ärvd från CollectionBase)
OnClearComplete()

Utför ytterligare anpassade processer när innehållet i instansen har rensats CollectionBase .

(Ärvd från CollectionBase)
OnInsert(Int32, Object)

Utför ytterligare anpassade processer innan du infogar ett nytt element i instansen CollectionBase .

(Ärvd från CollectionBase)
OnInsertComplete(Int32, Object)

Utför ytterligare anpassade processer när du har infogat ett nytt element i instansen CollectionBase .

(Ärvd från CollectionBase)
OnRemove(Int32, Object)

Utför ytterligare anpassade processer när du tar bort ett element från instansen CollectionBase .

(Ärvd från CollectionBase)
OnRemoveComplete(Int32, Object)

Utför ytterligare anpassade processer när du har tagit bort ett element från instansen CollectionBase .

(Ärvd från CollectionBase)
OnSet(Int32, Object, Object)

Utför ytterligare anpassade processer innan du anger ett värde i instansen CollectionBase .

(Ärvd från CollectionBase)
OnSetComplete(Int32, Object, Object)

Utför ytterligare anpassade processer när du har angett ett värde i instansen CollectionBase .

(Ärvd från CollectionBase)
OnValidate(Object)

Utför ytterligare anpassade processer när du verifierar ett värde.

(Ärvd från CollectionBase)
Remove(SoapHeader)

Tar bort den första förekomsten av en specifik SoapHeader från SoapHeaderCollection.

RemoveAt(Int32)

Tar bort elementet vid det angivna indexet för instansen CollectionBase . Den här metoden kan inte åsidosättas.

(Ärvd från CollectionBase)
ToString()

Returnerar en sträng som representerar det aktuella objektet.

(Ärvd från Object)

Explicita gränssnittsimplementeringar

Name Description
ICollection.CopyTo(Array, Int32)

Kopierar hela CollectionBase till en kompatibel endimensionell Array, med början vid det angivna indexet för målmatrisen.

(Ärvd från CollectionBase)
ICollection.IsSynchronized

Hämtar ett värde som anger om åtkomsten CollectionBase till är synkroniserad (trådsäker).

(Ärvd från CollectionBase)
ICollection.SyncRoot

Hämtar ett objekt som kan användas för att synkronisera åtkomsten CollectionBasetill .

(Ärvd från CollectionBase)
IList.Add(Object)

Lägger till ett objekt i slutet av CollectionBase.

(Ärvd från CollectionBase)
IList.Contains(Object)

Avgör om innehåller CollectionBase ett specifikt element.

(Ärvd från CollectionBase)
IList.IndexOf(Object)

Söker efter den angivna Object och returnerar det nollbaserade indexet för den första förekomsten i hela CollectionBase.

(Ärvd från CollectionBase)
IList.Insert(Int32, Object)

Infogar ett element i CollectionBase det angivna indexet.

(Ärvd från CollectionBase)
IList.IsFixedSize

Hämtar ett värde som anger om har CollectionBase en fast storlek.

(Ärvd från CollectionBase)
IList.IsReadOnly

Hämtar ett värde som anger om är CollectionBase skrivskyddat.

(Ärvd från CollectionBase)
IList.Item[Int32]

Hämtar eller anger elementet vid det angivna indexet.

(Ärvd från CollectionBase)
IList.Remove(Object)

Tar bort den första förekomsten av ett specifikt objekt från CollectionBase.

(Ärvd från CollectionBase)

Tilläggsmetoder

Name Description
AsParallel(IEnumerable)

Möjliggör parallellisering av en fråga.

AsQueryable(IEnumerable)

Konverterar en IEnumerable till en IQueryable.

Cast<TResult>(IEnumerable)

Omvandlar elementen i en IEnumerable till den angivna typen.

OfType<TResult>(IEnumerable)

Filtrerar elementen i en IEnumerable baserat på en angiven typ.

Gäller för

Se även