A
Amoril
I am currently developing an app that will post an XML file (1 to
100MB+ in size) to an outside vendor application via HTTPS Post (doing
this in a vb.net windows app). The vendor will then at some later date
post an updated return XML file to my webserver (asp.net). The primary
problem I'm having is getting the posted stream to load in an
XMLDocument object. When trying to read the posted stream into the
XMLDocument the following error is kicked back from my webserver (seen
by the vendor), "The remote server returned an error: (500) Internal
Server Error." At minimum I want to make sure that the XML they're
posting to me is well-formed so I don't need to load it into an
XMLDocument object if there's another way to do it.
Also they're expecting to post their info to me via HTTPS, how can I
set up my page so it's looking for credentials to be passed along with
the XML stream? I see how to send credentials to them using
System.Net.NetworkCredential, but I don't see how accept credentials
from the vendor when they post to me.
Code used to accept HTTP post from Vendor:
Dim str As Stream
Dim strmContent As String
Dim strLen As Integer
Dim strRead As Integer
'Request input stream from the poster
str = Request.InputStream
'Get the length of incoming string
strLen = str.Length
'make a Byte array the size of the stream
Dim strArr(strLen) As Byte
'read the stream into the array
strRead = str.Read(strArr, 0, strLen)
'the stream will be ASCII encoded
Dim ascii As ASCIIEncoding = New ASCIIEncoding
'Get ASCII into reg. string here
strmContent = ascii.GetString(strArr)
Dim doc As XmlDocument = New XmlDocument
doc.LoadXml(strmContent)
doc.Save("D:\temp\test5.xml")
'Return Response to poster.
Response.Write("some response")
Any suggestions on what I can do to fix this or possible resources that
might help me out?
Thanks!
100MB+ in size) to an outside vendor application via HTTPS Post (doing
this in a vb.net windows app). The vendor will then at some later date
post an updated return XML file to my webserver (asp.net). The primary
problem I'm having is getting the posted stream to load in an
XMLDocument object. When trying to read the posted stream into the
XMLDocument the following error is kicked back from my webserver (seen
by the vendor), "The remote server returned an error: (500) Internal
Server Error." At minimum I want to make sure that the XML they're
posting to me is well-formed so I don't need to load it into an
XMLDocument object if there's another way to do it.
Also they're expecting to post their info to me via HTTPS, how can I
set up my page so it's looking for credentials to be passed along with
the XML stream? I see how to send credentials to them using
System.Net.NetworkCredential, but I don't see how accept credentials
from the vendor when they post to me.
Code used to accept HTTP post from Vendor:
Dim str As Stream
Dim strmContent As String
Dim strLen As Integer
Dim strRead As Integer
'Request input stream from the poster
str = Request.InputStream
'Get the length of incoming string
strLen = str.Length
'make a Byte array the size of the stream
Dim strArr(strLen) As Byte
'read the stream into the array
strRead = str.Read(strArr, 0, strLen)
'the stream will be ASCII encoded
Dim ascii As ASCIIEncoding = New ASCIIEncoding
'Get ASCII into reg. string here
strmContent = ascii.GetString(strArr)
Dim doc As XmlDocument = New XmlDocument
doc.LoadXml(strmContent)
doc.Save("D:\temp\test5.xml")
'Return Response to poster.
Response.Write("some response")
Any suggestions on what I can do to fix this or possible resources that
might help me out?
Thanks!