本文整理匯總了VB.NET中System.Web.Services.Description.OperationMessage類的典型用法代碼示例。如果您正苦於以下問題:VB.NET OperationMessage類的具體用法?VB.NET OperationMessage怎麽用?VB.NET OperationMessage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了OperationMessage類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: MyOperationMessageSample
' 導入命名空間
Imports System.Xml
Imports System.Web.Services
Imports System.Web.Services.Description
Class MyOperationMessageSample
Shared Sub Main()
Try
Dim myDescription As ServiceDescription = _
ServiceDescription.Read("MathService_input_vb.wsdl")
Dim myPortTypeCollection As PortTypeCollection = _
myDescription.PortTypes
' Get the OperationCollection for the SOAP protocol.
Dim myOperationCollection As OperationCollection = _
myPortTypeCollection(0).Operations
' Get the OperationMessageCollection for the Add operation.
Dim myOperationMessageCollection As OperationMessageCollection = _
myOperationCollection(0).Messages
Dim myInputOperationMessage As OperationMessage = _
CType(New OperationInput(), OperationMessage)
Dim myXmlQualifiedName As New XmlQualifiedName("AddSoapIn", _
myDescription.TargetNamespace)
myInputOperationMessage.Message = myXmlQualifiedName
myOperationMessageCollection.Insert(0, myInputOperationMessage)
' Display the operation name of the InputMessage.
Console.WriteLine("The operation name is " & _
myInputOperationMessage.Operation.Name)
' Add the OperationMessage to the collection.
myDescription.Write("MathService_new_vb.wsdl")
Catch e As Exception
Console.WriteLine("Exception caught!!!")
Console.WriteLine("Source : " & e.Source.ToString())
Console.WriteLine("Message : " & e.Message.ToString())
End Try
End Sub
End Class