如何阅读SOAP响应?

时间:2011-09-06 10:56:53

标签: vb.net soap

如何阅读SOAP响应?在函数下面,只读取一些特定的节点。 我想阅读整个SOAP响应。

<System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace:="urn:OpenEdgeServices:TEST:TEST", ResponseNamespace:="urn:OpenEdgeServices:TEST:TEST", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
        Public Function webdirect(<System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByVal Company As System.Nullable(Of Integer), <System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByVal LocationCode As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByVal CustomerNumber As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByVal OrderNumber As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByVal OrderRef As String, <System.Xml.Serialization.XmlElementAttribute(DataType:="date", IsNullable:=True)> ByVal OrderDate As System.Nullable(Of Date), <System.Xml.Serialization.XmlArrayAttribute(IsNullable:=True), System.Xml.Serialization.XmlArrayItemAttribute("WebLinesRow", IsNullable:=False)> ByVal WebLines() As webdirect_WebLinesRow, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByRef o_Company As System.Nullable(Of Integer), <System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByRef o_LocationCode As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByRef o_CustomerNumber As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByRef o_OrderNumber As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByRef o_OrderStatus As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=True)> ByRef o_OrdDescrip As String, <System.Xml.Serialization.XmlArrayAttribute(IsNullable:=True), System.Xml.Serialization.XmlArrayItemAttribute("RespLinesRow", IsNullable:=False)> ByRef RespLines() As webdirect_RespLinesRow) As <System.Xml.Serialization.XmlElementAttribute("result", IsNullable:=True)> String
            Dim results() As Object = Me.Invoke("webdirect", New Object() {Company, LocationCode, CustomerNumber, OrderNumber, OrderRef, OrderDate, WebLines})
            o_Company = CType(results(1), System.Nullable(Of Integer))
            o_LocationCode = CType(results(2), String)
            o_CustomerNumber = CType(results(3), String)
            o_OrderNumber = CType(results(4), String)
            o_OrderStatus = CType(results(5), String)
            o_OrdDescrip = CType(results(6), String)
            RespLines = CType(results(7), webdirect_RespLinesRow())
            Return CType(results(0), String)
        End Function

1 个答案:

答案 0 :(得分:0)

SOAP响应只是XML代码。只需像普通的XML一样解析它。

相关问题