Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Request Object

Reply
Thread Tools

Request Object

 
 
deepak
Guest
Posts: n/a
 
      02-12-2008
Hi All,

i m facing a strange situation with request object for asp.net.As per our
project i have to transfer this request from Page1.aspx to Page2.aspx if
contyp = "text/xml".If i remove(ie. comment) the line
xmlInDoc.Load(Request.InputStream) from PAGE1.ASPX then there is no error in
PAGE2.ASPX and it process it without any error,but if i keep this line
xmlInDoc.Load(Request.InputStream) in PAGE1.ASPX then PAGE2.ASPX give me
error on line Response.Write(docOUT.xml) saying

"""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""
<MethodResult
Status="2"><Error><ErrorNumber>-1071651496</ErrorNumber><ErrorDescription>An
XML parse error occured.
File Position: 0
Line: 0
Line Position: 0
Reason: XML document must have a top level element.

Source Text: </ErrorDescription><ErrorSource>modXML.LoadXMLDocume ntFromURL \\
W6IntInMsgLib</ErrorSource><ErrorLine>0</ErrorLine></Error></MethodResult>

"""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""

I can not remove(comment) the line xmlInDoc.Load(Request.InputStream) in
PAGE1.ASPX as that is needed for some processing in PAGE.ASPX like
Dim xmlearlyStart As XmlNode =
xmlInDoc.SelectSingleNode("SXPTaskUpdateOrAdd/Task/EarlyStart") etc.




Following is my code:

PAGE1.aspx

contyp = Request.ContentType() ' Read content type of request

If contyp = "text/xml" Then
Dim xmlInDoc As New XmlDocument
Dim xmlInUpdateDoc As New XmlDocument

xmlInDoc.Load(Request.InputStream)
Server.Transfer("w6inboundprocessor.aspx", True)


PAGE2.aspx

Public Class w6inboundprocessor
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

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.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

On Error Resume Next

Const W6PIncomingProcessor = "W6IntUtilsGWWrap.W6IntInMsgProcGW.1"

Dim binData
Dim objProcessor
Dim docOUT
Dim blnSuccess


binData = Request.BinaryRead(Request.TotalBytes())

If Err.Number <> 0 Then Call XMLError(Err)

blnSuccess = False
While Not blnSuccess
' Based on Microsoft's articles there is no need to use the
Server object to create objects.
' If we do use the Server objects it costs in performance
' and can cause some instability as the bug suggests.
objProcessor = CreateObject(W6PIncomingProcessor)


If Err.Number = 0 Then
blnSuccess = True
Else
If Err.Number <> 2147549448 Then
Call XMLError(Err)
blnSuccess = True
End If
End If
End While
' Danny 15/5/05 - Bug #23983
' Based on Microsoft's articles there is no need to use the Server
object to create objects.
' If we do use the Server objects it costs in performance
' and can cause some instability as the bug suggests.
docOUT = CreateObject("Microsoft.XMLDOM")
Call docOUT.loadXML(objProcessor.ProcessMessage(binData ))
If Err.Number <> 0 Then Call XMLError(Err)
Response.ContentType = "text/xml"
' Gil (27/2/05): Bug: #23639 - Added unicode support as in the SXP
asp file
' Reviewed with Sasha.
Response.Charset = "utf-8"

'docOUT.save(Response)
Response.Write(docOUT.xml)
Response.End()



End Sub
Sub XMLError(ByVal Err)
Dim strOutput

strOutput = "<MethodResult><Error>" & _
"<ErrorNumber>" & Err.Number & "</ErrorNumber>" & _
"<ErrorDescription>" & Err.Description &
"</ErrorDescription>" & _
"<ErrorSource>" & Err.Source & "</ErrorSource>" & _
"</Error></MethodResult>"

Call Response.Write(strOutput)
Response.End()
End Sub
End Class



Kindly help me. I am waiting for urs replies and thanks in advance from my
side.


-Deepak
+919886735837
http://www.velocityreviews.com/forums/(E-Mail Removed)
(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      02-12-2008
deepak wrote:
> Hi All,
>
> i m facing a strange situation with request object for asp.net.As per


There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic asp newsgroup. ASP.Net bears
very little resemblance to classic ASP so, while you may be lucky enough to
find a dotnet-knowledgeable person here who can answer your question, you
can eliminate the luck factor by posting your question to a group where
those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.aspnet or the forums at www.asp.net.



--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      02-12-2008
"Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> deepak wrote:
> > Hi All,
> >
> > i m facing a strange situation with request object for asp.net.As per

>
> There was no way for you to know it (except maybe by browsing through some
> of the previous questions in this newsgroup before posting yours - always

a
> recommended practice) , but this is a classic asp newsgroup.


Although in this case he does know it, because Deepak is a serial
multi-poster and has posted this message in at least two other dotnet
groups. <grrr...>

--
Anthony Jones - MVP ASP/ASP.NET


 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
System. Web. Services. Protocols. SoapException: Server was unable to process request.---> Object reference not set to an instance of an object. Florencio Laso ASP .Net Web Services 1 03-27-2007 11:48 AM
Just got two emails: 1. your request for a new Access Code and 2. Request for my MCP ID# What's going on??!! belfast-biker Microsoft Certification 0 01-14-2006 12:49 PM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
Re: Accessing Request.InputStream / Request.BinaryRead *as the request is occuring*: How??? Brian Birtle ASP .Net 2 10-16-2003 02:11 PM
System.Web.HttpException: Request timed out - [HttpException (0x80004005): Request timed out.] Steve ASP .Net 0 07-01-2003 12:11 AM



Advertisments