implement soap listener

S

Sai

Friends,

Like to implement soap listener using C#.net, Can any one shed some
light on how to do this.

Thanks,
K
 
K

Kevin Spencer

Create a web services project in any version of Visual Studio.Net.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.
 
S

Sai

Kevin,

I know I have to create web service, but I don't know how to invoke
soap listner. Some lines of code will do.

Thanks,
k
 
G

Guest

Sai,
What Kevin is (correctly) saying is that a webservice IS a "SOAP LISTENER".
As soon as it receives a SOAP message it processes it and returns the result.
Peter
 
S

Sai

Thanks for your help guys.

Peter,

here is where a SOAP request will be sent to me from the mainframe.
Currently I am reading the XMM file from a web server but I'm not
sure how the mainframe will be sending me the SOAP document so I am
unsure how to load the request and parse it.

Check the following code. Now I don't know how to read it.

Public Function SendData() As String
Dim i As Integer = 1
Dim iDataTag As Integer
Dim iCaseId As Integer
Dim sCivActNbrTR As String
Dim sPacketId As String

Dim reader As XmlTextReader = New
XmlTextReader("http://localhost//mis//apps//wsformq//forms.xmm")

While reader.Read()
Select Case reader.NodeType
Case XmlNodeType.Element
Select Case Trim(reader.Name)
Case "CASE-ID-TR"
iDataTag = 1
Case "CIV-ACT-NBR-TR"
iDataTag = 2
Case "PACKET-ID-TR"
iDataTag = 3
Case ""
iDataTag = 0
End Select
Case XmlNodeType.Text
Select Case iDataTag
Case 1
iCaseId = reader.Value
Case 2
sCivActNbrTR = reader.Value
Case 3
sPacketId = reader.Value
End Select
Case XmlNodeType.EndElement
iDataTag = 0
End Select
i = i + 1
End While

' building the url to send the data via post
Dim strPostUrl As String =
"http://localhost/mis/apps/wsformq/test01.asp"
Dim strPostData As String = "CASE-ID-TR='" & iCaseId &
"'&CIVIL-ACTION-NBR-TR='" & sCivActNbrTR & "'&PACKET-ID-TR='" &
sPacketId & "'"
Dim strNewPostUrl As String = strPostUrl & "?" & strPostData

' sending the data via HTTP post
Dim web As New System.Net.WebClient
web.Headers.Add("Content-Type",
"application/x-www-form-urlencoded")
Dim d As Byte() =
System.Text.Encoding.ASCII.GetBytes(strPostData)
Dim res As Byte() = web.UploadData(strPostUrl, "POST", d)
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top