SoapHeaderCollection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
包含 SoapHeader 類別的執行個體集合。
public ref class SoapHeaderCollection : System::Collections::CollectionBase
public class SoapHeaderCollection : System.Collections.CollectionBase
type SoapHeaderCollection = class
inherit CollectionBase
Public Class SoapHeaderCollection
Inherits CollectionBase
- 繼承
範例
[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
建構函式
SoapHeaderCollection() |
初始化 SoapHeaderCollection 類別的新執行個體。 |
屬性
Capacity |
取得或設定 CollectionBase 可包含的項目數目。 (繼承來源 CollectionBase) |
Count |
取得 CollectionBase 執行個體中包含的元素數目。 這個屬性無法覆寫。 (繼承來源 CollectionBase) |
InnerList |
取得包含 ArrayList 執行個體中之元素清單的 CollectionBase。 (繼承來源 CollectionBase) |
Item[Int32] |
取得或設定在 SoapHeader 的指定索引上的 SoapHeaderCollection。 |
List |
取得包含 IList 執行個體中之元素清單的 CollectionBase。 (繼承來源 CollectionBase) |
方法
明確介面實作
ICollection.CopyTo(Array, Int32) |
從目標陣列的指定索引開始,將整個 CollectionBase 複製到相容的一維 Array。 (繼承來源 CollectionBase) |
ICollection.IsSynchronized |
取得值,這個值表示對 CollectionBase 的存取是否同步 (安全執行緒)。 (繼承來源 CollectionBase) |
ICollection.SyncRoot |
取得可用以同步存取 CollectionBase 的物件。 (繼承來源 CollectionBase) |
IList.Add(Object) |
將物件加入至 CollectionBase 的末端。 (繼承來源 CollectionBase) |
IList.Contains(Object) |
判斷 CollectionBase 是否包含特定項目。 (繼承來源 CollectionBase) |
IList.IndexOf(Object) |
搜尋指定的 Object,並傳回在整個 CollectionBase 中第一個符合項目之以零為起始的索引。 (繼承來源 CollectionBase) |
IList.Insert(Int32, Object) |
將項目插入至 CollectionBase 中指定的索引位置。 (繼承來源 CollectionBase) |
IList.IsFixedSize |
取得值,指出 CollectionBase 是否有固定的大小。 (繼承來源 CollectionBase) |
IList.IsReadOnly |
取得值,指出 CollectionBase 是否唯讀。 (繼承來源 CollectionBase) |
IList.Item[Int32] |
在指定的索引位置上取得或設定項目。 (繼承來源 CollectionBase) |
IList.Remove(Object) |
從 CollectionBase 移除特定物件之第一個符合的元素。 (繼承來源 CollectionBase) |
擴充方法
Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
OfType<TResult>(IEnumerable) |
根據指定的型別來篩選 IEnumerable 的項目。 |
AsParallel(IEnumerable) |
啟用查詢的平行化作業。 |
AsQueryable(IEnumerable) |
將 IEnumerable 轉換成 IQueryable。 |