Response.StatusCode

S

Shane

Can someone tell me what the Response.StatusCode = "200"
is doing below? I have another program that sends a
stream of string data to the program below by using an
HttpWebRequest. I want to use the HttpWebResponse or
HttpResponse to get the status code back but it doesn't
seem to work. Is the Response.StatusCode assignment below
only visiable to the web application below or is this the
response that is sent back to any programs that may call
it?



Imports System.Web
Imports System.Web.Mail
Imports System.Net
Imports System.IO
Imports System.Xml


Public Class XMLGateway
Inherits System.Web.UI.Page

Private Sub Page_Init(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web
Form Designer
'Do not modify it using the code editor.
End Sub

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Dim xmlDoc As New XmlDocument()
Dim strMessageType As String
Dim PostStatus As Boolean = True
Dim strXML As Stream

strXML = Request.InputStream
strMessageType = UCase(Request.QueryString.Item
("Type"))
Select Case strMessageType
Case "CONTRACTINVITE"
Case "INTERCHANGEORDER"
Case "INTERCHANGERETURN"
Case "QUOTEREQUEST"
Case "SAMPLEORDERMKT"
Case "USERREGISTRATION"
Case Else : PostStatus = False
Response.StatusCode = "401"
Exit Sub
End Select
xmlDoc.Load(strXML)

Dim strTime As String = TimeOfDay
strTime = Replace(strTime, ":", "")
Try
xmlDoc.Save("c:\HTTP Incoming\" &
strMessageType & "_" & strTime & "_" & CType(Rnd(),
String) & ".xml")
Catch
PostStatus = False
End Try
If PostStatus = True Then
Response.StatusCode = "200"
Else
Response.StatusCode = "400"
End If
End Sub

End Class
 

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

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top