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
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