receive https post (asp.net)

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 P­ost
(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). T­he
primary
problem I'm having is getting the posted stream to load in a­n
XMLDocument object. When trying to read the posted stream in­to the
XMLDocument the following error is kicked back from my webse­rver
(seen
by the vendor), "The remote server returned an error: (500) ­Internal
Server Error." At minimum I want to make sure that the XML t­hey'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, h­ow 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 cre­dentials
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 res­ources
that
might help me out?


Thanks!
 

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

Top