REquest/response problem....

M

Mateo

Hi!

I have communication from asp.net aplication with some service on other
server.... I send them data, and they return me some data. I have to take
recived data and forward it to third server UNCHANGED!

This is my problem. When I receive first response with Request("Data"),
store it to the string variable and then I forward that data to third server
with HttpWebResponse it looks like this data is changed! It is actually
ancrypted data which can not be encripeted on third server becouse it is
changed during transmition.

This is how I forward my data:

Cold this be problem with code page or something???? Third server is using
utf-8 code page.... I use utf8 to....

Try

Dim sbHTMLResponse As New StringBuilder

Dim byte_data As Byte() = Encoding.UTF8.GetBytes(sFormData.ToString)

Dim NewRequest As HttpWebRequest = CType(WebRequest.Create(sUrl),
HttpWebRequest)

NewRequest.Method = "POST"

NewRequest.ContentType = "application/x-www-form-urlencoded"

NewRequest.ContentLength = byte_data.Length

NewRequest.AllowAutoRedirect = False 'kad saljemo webtehu

Dim oNewRequestStream As Stream = NewRequest.GetRequestStream()

oNewRequestStream.Write(byte_data, 0, byte_data.Length)

oNewRequestStream.Close()

Dim oHttpWebResponse As HttpWebResponse = CType(NewRequest.GetResponse(),
HttpWebResponse)

Dim oNewResponseStream As Stream = oHttpWebResponse.GetResponseStream()

sbHTMLResponse.Append(New StreamReader(oNewResponseStream).ReadToEnd())

oNewResponseStream.Close()

Return sbHTMLResponse.ToString



Catch ex As Exception

'neka onda funkcija samo vrati nas gn_NoData

Return bcommon.gnNO_DATA.ToString

End Try
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top