
Signature
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
Hi Joe,
Actually this asp.net page(having text box) is just a demo within us but in
production environment with customers, they will send this xml message
through http protocol then how we shoudl read this...kindly tell me i would
be greatful to u...
> > Hi All,
> >
[quoted text clipped - 34 lines]
> (May want to change the serialization mode enum depending on what you do
> with the info.)
deepak - 08 Feb 2008 23:11 GMT
Hi Joe,
the question is that how to get this xml as there is no textbox in real
production environment and this xml message will come through internet via
http protocol.
tHIS PAGE dont play any role in actual production environment and this is
just asumption that we r goign to process the message of production (present
in this text box) through this page but in actual the same xmlmessage
willcome through http protocol... then how to get the xml message through
request object like request.form.getvalues(...).....Kinldy tell me i would be
highly helped by this?
> Hi Joe,
>
[quoted text clipped - 41 lines]
> > (May want to change the serialization mode enum depending on what you do
> > with the info.)
Martin Honnen - 09 Feb 2008 12:03 GMT
> Actually this asp.net page(having text box) is just a demo within us but in
> production environment with customers, they will send this xml message
> through http protocol then how we shoudl read this...kindly tell me i would
> be greatful to u...
Assuming you have an ASP.NET page and that receives a HTTP POST request
with the XML in the request body then you can read in the XML as follows
Dim doc As New XmlDocument()
Try
doc.Load(Request.InputStream)
' now use doc here e.g.
Dim earlyStart As XmlNode =
doc.SelectSingleNode("SXPTaskUpdateOrAdd/Task/EarlyStart")
Catch e As XmlException
' handle exception here
End Try

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
deepak - 09 Feb 2008 17:48 GMT
Hi Martin,
Hope u r fine. I tried your code i.e. Request.InputStream but its giving me
'nothing' in quick watch of Visual Studio IDE then i tried
Request.Form.Item("SXP").GetValue(0) ,its also giving me nothing(and hence
error object refrce not set to instance of object)
but if i try to add any attachment file (say hi.txt) through 2nd texbox
present in the asp.net page(as i tokd u before ther are 2 textboxex available
on that asp.net page 1. for sending sxptaskuodate or add message
2. for adding any attachment with sxptaskupdateoradd mesage after browsing
the file say hi.txt.
so if i try to add any attachment and then lick on submit while sending the
sxptaskupdateoradd message , i gets that entire sxp message in
Request.Form.Item("SXP").GetValue(0) as string i.e. "<SXPTaskUpdateORAdd...."
why it is so means the question is that if i add any attachment then i can
read this sxptaskupdateorAdd in Request.Form.Item("SXP").GetValue(0) but if
i dont add any attachment file i.e. that texbox having path of file is empty
then i dont get anything in Request.Form.Item("SXP").GetValue(0) and gets
"object refercene not set to instance...." error .My aim is to read that
sxptaskupdateoradd message even if there is no attachment file with this
message.Your way Request.InputStream is giving me null value.
In actual producion environment this SXPTaskUpdateorAdd will come via http
protocol throgh internet and this asp.net demo page will not be there.This
page is with us just to do testing on our side as a demo assmuing that this
message is comign from customer side.
Kindly give some more efforts,it would be great help for me and my project
really.
- Deepak
kr_deepak123@hotmail.com
kr_deepak123@yahoo.co.in
> > Actually this asp.net page(having text box) is just a demo within us but in
> > production environment with customers, they will send this xml message
[quoted text clipped - 13 lines]
> ' handle exception here
> End Try
Martin Honnen - 09 Feb 2008 18:05 GMT
> In actual producion environment this SXPTaskUpdateorAdd will come via http
> protocol throgh internet and this asp.net demo page will not be there.This
> page is with us just to do testing on our side as a demo assmuing that this
> message is comign from customer side.
Well my suggestion to use Request.InputStream is meant to be used when
you have an ASP.NET page to which someone makes a HTTP POST request with
the XML sent in the request body. So assuming you have
http://example.com/receive.aspx and someone makes a HTTP POST request to
that URL then you can use Request.InputStream and read out the posted XML.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
deepak - 09 Feb 2008 18:42 GMT
hey martin,
may u give me urs any messenger id(hotmail or yahoo)?
> > In actual producion environment this SXPTaskUpdateorAdd will come via http
> > protocol throgh internet and this asp.net demo page will not be there.This
[quoted text clipped - 6 lines]
> http://example.com/receive.aspx and someone makes a HTTP POST request to
> that URL then you can use Request.InputStream and read out the posted XML.
deepak - 11 Feb 2008 13:15 GMT
Hi Martin,
your method of using Request.InputStream is working fine.i juct debugged
and checked and its showing values in quick watch...thanks a lot
again....really..
Thanks,
Deepak
> hey martin,
>
[quoted text clipped - 10 lines]
> > http://example.com/receive.aspx and someone makes a HTTP POST request to
> > that URL then you can use Request.InputStream and read out the posted XML.