Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Response.StatusCode

Reply
Thread Tools

Response.StatusCode

 
 
Shane
Guest
Posts: n/a
 
      11-20-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57