B
Barbara Alderton
I have a .NET web service that takes in a dataset based on defined schema and
outputs the same type, which utilizes a SOAP header. I have a testharness
which I use to call the web service, which conducts different actions
depending on an action field set in the header. I set the header fields and
attach the header to the proxy object and then call the web service. I am
able to display the incoming and outgoing datasets as xml for testing.
However, what I really want to do is display the complete SOAP message.
For example:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
---->
<soapenv:Header>
----
</soapenv:Header>
<soapenv:Body>
----
</soapenv:Body>
</soapenv:Envelope>
Current sample code:
Dim objtest As ProxyClass = New ProxyClass
Dim TestHeader As SSSoapHeader = New SSSoapHeader
Dim dsMessageOut As New DataSetSchema
Dim dsMessageIn As New DataSetSchema
Dim strMessageType As String
Select Case strMessageType
Case Type1
TestHeader.Action = strMessageType
TestHeader.TransDatetime = Now
Dim fs As New
FileStream(HttpContext.Current.Server.MapPath("TestDataIn.xml"), _
FileMode.Open, FileAccess.Read)
Dim xmlStream As New StreamReader(fs)
dsMessageOut.ReadXml(xmlStream)
' Add the TestHeader SOAP header to the SOAP request.
objtest.SSSoapHeaderValue = TestHeader
' Call Web Service
dsMessageIn = objtest.ProcessMessage(dsMessageOut)
TestHeader = objtest.SSSoapHeaderValue
' Display header values
lblAction.Text = TestHeader.Action
lblTransDt.Text = TestHeader.TransDatetime
txtXML.Text = dsMessageOut.GetXml + dsMessageIn.GetXml
End Select
How can I retrieve the SOAP message and display to a multi-line textbox, as
I am the in/out datasets?
outputs the same type, which utilizes a SOAP header. I have a testharness
which I use to call the web service, which conducts different actions
depending on an action field set in the header. I set the header fields and
attach the header to the proxy object and then call the web service. I am
able to display the incoming and outgoing datasets as xml for testing.
However, what I really want to do is display the complete SOAP message.
For example:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
---->
<soapenv:Header>
----
</soapenv:Header>
<soapenv:Body>
----
</soapenv:Body>
</soapenv:Envelope>
Current sample code:
Dim objtest As ProxyClass = New ProxyClass
Dim TestHeader As SSSoapHeader = New SSSoapHeader
Dim dsMessageOut As New DataSetSchema
Dim dsMessageIn As New DataSetSchema
Dim strMessageType As String
Select Case strMessageType
Case Type1
TestHeader.Action = strMessageType
TestHeader.TransDatetime = Now
Dim fs As New
FileStream(HttpContext.Current.Server.MapPath("TestDataIn.xml"), _
FileMode.Open, FileAccess.Read)
Dim xmlStream As New StreamReader(fs)
dsMessageOut.ReadXml(xmlStream)
' Add the TestHeader SOAP header to the SOAP request.
objtest.SSSoapHeaderValue = TestHeader
' Call Web Service
dsMessageIn = objtest.ProcessMessage(dsMessageOut)
TestHeader = objtest.SSSoapHeaderValue
' Display header values
lblAction.Text = TestHeader.Action
lblTransDt.Text = TestHeader.TransDatetime
txtXML.Text = dsMessageOut.GetXml + dsMessageIn.GetXml
End Select
How can I retrieve the SOAP message and display to a multi-line textbox, as
I am the in/out datasets?