MimeContentBinding.Part 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置 MessagePart 要应用于的 MimeContentBinding 的名称。
public:
property System::String ^ Part { System::String ^ get(); void set(System::String ^ value); };
public string Part { get; set; }
member this.Part : string with get, set
Public Property Part As String
属性值
一个字符串,表示当前 MessagePart 与之关联的 MimeContentBinding 的名称。 默认值为空字符串 ("")。
示例
ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MimeContentSample_cpp.wsdl" );
// Get the Binding.
Binding^ myBinding = myServiceDescription->Bindings[ "b1" ];
// Get the first OperationBinding.
OperationBinding^ myOperationBinding = myBinding->Operations[ 0 ];
OutputBinding^ myOutputBinding = myOperationBinding->Output;
ServiceDescriptionFormatExtensionCollection ^ myServiceDescriptionFormatExtensionCollection = myOutputBinding->Extensions;
// Find all MimeContentBinding objects in extensions.
array<MimeContentBinding^>^myMimeContentBindings = (array<MimeContentBinding^>^)myServiceDescriptionFormatExtensionCollection->FindAll( MimeContentBinding::typeid );
// Enumerate the array and display MimeContentBinding properties.
IEnumerator^ myEnum = myMimeContentBindings->GetEnumerator();
while ( myEnum->MoveNext() )
{
MimeContentBinding^ myMimeContentBinding = safe_cast<MimeContentBinding^>(myEnum->Current);
Console::WriteLine( "Type: {0}", myMimeContentBinding->Type );
Console::WriteLine( "Part: {0}", myMimeContentBinding->Part );
}
ServiceDescription myServiceDescription =
ServiceDescription.Read("MimeContentSample_cs.wsdl");
// Get the Binding.
Binding myBinding = myServiceDescription.Bindings["b1"];
// Get the first OperationBinding.
OperationBinding myOperationBinding = myBinding.Operations[0];
OutputBinding myOutputBinding = myOperationBinding.Output;
ServiceDescriptionFormatExtensionCollection
myServiceDescriptionFormatExtensionCollection =
myOutputBinding.Extensions;
// Find all MimeContentBinding objects in extensions.
MimeContentBinding[] myMimeContentBindings = (MimeContentBinding[])
myServiceDescriptionFormatExtensionCollection.FindAll(
typeof(MimeContentBinding));
// Enumerate the array and display MimeContentBinding properties.
foreach(MimeContentBinding myMimeContentBinding in
myMimeContentBindings)
{
Console.WriteLine("Type: " + myMimeContentBinding.Type);
Console.WriteLine("Part: " + myMimeContentBinding.Part);
}
Dim myServiceDescription As ServiceDescription = _
ServiceDescription.Read ("MimeContentSample_vb.wsdl")
' Get the Binding.
Dim myBinding As Binding = myServiceDescription.Bindings("b1")
' Get the first OperationBinding.
Dim myOperationBinding As OperationBinding = myBinding.Operations(0)
Dim myOutputBinding As OutputBinding = myOperationBinding.Output
Dim myServiceDescriptionFormatExtensionCollection As _
ServiceDescriptionFormatExtensionCollection = _
myOutputBinding.Extensions
' Find all MimeContentBinding objects in extensions.
Dim myMimeContentBindings As MimeContentBinding() = _
CType(myServiceDescriptionFormatExtensionCollection.FindAll( _
GetType(MimeContentBinding)), MimeContentBinding())
' Enumerate the array and display MimeContentBinding properties.
Dim myMimeContentBinding As MimeContentBinding
For Each myMimeContentBinding In myMimeContentBindings
Console.WriteLine("Type: " & myMimeContentBinding.Type)
Console.WriteLine("Part: " & myMimeContentBinding.Part)
Next myMimeContentBinding