本文整理汇总了VB.NET中System.Web.Services.Description.MimePart类的典型用法代码示例。如果您正苦于以下问题:VB.NET MimePart类的具体用法?VB.NET MimePart怎么用?VB.NET MimePart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MimePart类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: MyMimePart
' 导入命名空间
Imports System.Xml
Imports System.Web.Services.Description
Public Class MyMimePart
Public Shared Sub Main()
Dim myServiceDescription As ServiceDescription = _
ServiceDescription.Read("MimePart_3_Input_vb.wsdl")
Dim myServiceDescriptionCol As New ServiceDescriptionCollection()
myServiceDescriptionCol.Add(myServiceDescription)
Dim myXmlQualifiedName As _
New XmlQualifiedName("MimeServiceHttpPost", "http://tempuri.org/")
' Create the Binding.
Dim myBinding As Binding = _
myServiceDescriptionCol.GetBinding(myXmlQualifiedName)
Dim myOperationBinding As OperationBinding = Nothing
Dim i As Integer
For i = 0 To myBinding.Operations.Count - 1
If myBinding.Operations(i).Name.Equals("AddNumbers") Then
myOperationBinding = myBinding.Operations(i)
End If
Next i
' Create the OutputBinding.
Dim myOutputBinding As OutputBinding = myOperationBinding.Output
Dim myMimeXmlBinding As New MimeXmlBinding()
myMimeXmlBinding.Part = "body"
' Create the MimePart.
Dim myMimePart As New MimePart()
myMimePart.Extensions.Add(myMimeXmlBinding)
Dim myMimePartRelatedBinding As New MimeMultipartRelatedBinding()
' Add the MimePart to the MimePartRelatedBinding.
myMimePartRelatedBinding.Parts.Add(myMimePart)
myOutputBinding.Extensions.Add(myMimePartRelatedBinding)
myServiceDescription.Write("MimePart_3_Output_vb.wsdl")
Console.WriteLine( _
"MimePart_3_Output_vb.wsdl has been generated successfully.")
End Sub
End Class