如何从Web服务中提取肥皂消息 [英] How to extract soap message from web service

查看:116
本文介绍了如何从Web服务中提取肥皂消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Web服务的新用户.

我有一个问题:我想取出(提取)我在网络上发布的Web服务收到的一条肥皂消息,并将其保存在txt文件中.

请在下面找到我发布的Web服务:

Hi, I''m a new web service user.

I have a question: I would like to take out (to extract) a soap message received by web service I published on the web, and save it in a txt file.

Please find below my web service published:

'------------------------------------------------------------------------------
' <auto-generated>
' Il codice è stato generato da uno strumento.
' Versione runtime:2.0.50727.3603
'
' Le modifiche apportate a questo file possono provocare un comportamento 
' non corretto e andranno perse se
' il codice viene rigenerato.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization

'
'Codice sorgente generato automaticamente da wsdl, versione=2.0.50727.3038.
'

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"), _
System.Web.Services.WebServiceAttribute([Namespace]:="http://xxx.xx.xx/xx/xx/xx"), _
System.Web.Services.WebServiceBindingAttribute(Name:="InviaEsitoBinding", 
    [Namespace]:="http://xx.xx.it/xx/xx/xx"), _
System.Xml.Serialization.XmlIncludeAttribute(GetType(MessaggioNA))> _
Partial Public MustInherit Class InviaEsitoService
Inherits System.Web.Services.WebService

'''<remarks/>
<System.Web.Services.WebMethodAttribute(), _
System.Web.Services.Protocols.SoapDocumentMethodAttribute("inviaEsito", OneWay:=true,
   Use:=System.Web.Services.Description.SoapBindingUse.Literal, 
   ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _
Public MustOverride Sub inviaEsito(<System.Xml.Serialization.XmlElementAttribute("inviaEsito", 
    [Namespace]:="http://xxx.xxx.it/xx/xx/xx")> ByVal inviaEsito1 As inviaEsito)
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true, 
    [Namespace]:="http://regione.toscana.it/sis/rfc/na")> _
Partial Public Class inviaEsito

Private esitoField As Esito

'''<remarks/>
Public Property Esito() As Esito
Get
Return Me.esitoField
End Get
Set
Me.esitoField = value
End Set
End Property
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true, 
    [Namespace]:="http://xxx.xx.it/xx/xx/xx")> _
Partial Public Class Esito
Inherits MessaggioNA

Private successoField As Boolean

Private erroriField() As Errore

Private avvisiField() As Avviso

'''<remarks/>
Public Property Successo() As Boolean
Get
Return Me.successoField
End Get
Set
Me.successoField = value
End Set
End Property

'''<remarks/>
<System.Xml.Serialization.XmlArrayItemAttribute(IsNullable:=false)> _
Public Property Errori() As Errore()
Get
Return Me.erroriField
End Get
Set
Me.erroriField = value
End Set
End Property

'''<remarks/>
<System.Xml.Serialization.XmlArrayItemAttribute(IsNullable:=false)> _
Public Property Avvisi() As Avviso()
Get
Return Me.avvisiField
End Get
Set
Me.avvisiField = value
End Set
End Property
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://xx.xx.it/xx/xx/xx")> _
Partial Public Class Errore

Private codiceField As ErroreCodice

Private descrizioneField As String

'''<remarks/>
Public Property Codice() As ErroreCodice
Get
Return Me.codiceField
End Get
Set
Me.codiceField = value
End Set
End Property

'''<remarks/>
Public Property Descrizione() As String
Get
Return Me.descrizioneField
End Get
Set
Me.descrizioneField = value
End Set
End Property
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"), _
System.SerializableAttribute(), _
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true, 
    [Namespace]:="http://xx.xx.it/xx/xx/xx")> _
Public Enum ErroreCodice

'''<remarks/>
SYN

'''<remarks/>
CNT

'''<remarks/>
ELB

'''<remarks/>
IDN
End Enum

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://xx.xx.it/xx/xx/xx")> _
Partial Public Class Avviso

Private codiceField As AvvisoCodice

Private descrizioneField As String

'''<remarks/>
Public Property Codice() As AvvisoCodice
Get
Return Me.codiceField
End Get
Set
Me.codiceField = value
End Set
End Property

'''<remarks/>
Public Property Descrizione() As String
Get
Return Me.descrizioneField
End Get
Set
Me.descrizioneField = value
End Set
End Property
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"), _
System.SerializableAttribute(), _
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true, 
    [Namespace]:="http://xx.xx.it/xx/xx/xx")> _
Public Enum AvvisoCodice

'''<remarks/>
ANAG
End Enum

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://xx.xx.it/xx/xx/xx")> _
Partial Public MustInherit Class MessaggioNA

Private codiceInvianteField As String

Private dataInvioField As Date

Private codiceMessaggioField As String

'''<remarks/>
Public Property CodiceInviante() As String
Get
Return Me.codiceInvianteField
End Get
Set
Me.codiceInvianteField = value
End Set
End Property

'''<remarks/>
Public Property DataInvio() As Date
Get
Return Me.dataInvioField
End Get
Set
Me.dataInvioField = value
End Set
End Property

'''<remarks/>
Public Property CodiceMessaggio() As String
Get
Return Me.codiceMessaggioField
End Get
Set
Me.codiceMessaggioField = value
End Set
End Property
End Class
Public Class Form1
Sub test()
MsgBox("START: ")
End Sub

End Class

推荐答案

在运行应用程序时执行此操作的一种好方法是使用TCP监视器或Fiddler之类的工具.这将显示通过电线发送的整个肥皂消息.您可以根据需要将SOAP消息保存到文本文件中.
A neat way to do this while running an application is to use a tool like TCP monitor or fiddler. This will show you the entire soap message that was sent across the wire. You can save your SOAP message to a text file as desired.


您可以通过调用SOAP接口来解析任何SOAP消息以获取数据.

检查一下:

从肥皂消息中提取肥皂体 [
You can parse any SOAP message for data by calling the SOAP interface.

Check this :

Extract Soap Body From Soap Message[^]
to extract body of the SOAP envelope.

But why do you need this. .NET has built in capability to create custom Types based on these SOAP envelope. :confused:


这篇关于如何从Web服务中提取肥皂消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆