Hai i have developed an web service and i am testing it by calling like this
it is giving an Error 500 Remoteserver returned an error the calling code as follows please help how to solve
Dim Request As WebRequest = WebRequest.Create("http://156.11.127.18/test/Service.asmx")
Request.Method = "POST"
Dim PostData As String = "<response><TransactionId>12</TransactionId><VendorTransactionId>13</VendorTransactionId></response>"
Dim ByteArray As Byte() = Encoding.UTF8.GetBytes(PostData)
Dim Instance As New WebException
Dim Value As WebExceptionStatus
Request.ContentType = "application/x-www-form-urlencoded"
'Request.ContentType = "XML"
' Set the ContentLength property of the WebRequest.
Request.ContentLength = ByteArray.Length
' Get the Request stream.
Dim dataStream As Stream = Request.GetRequestStream()
' Write the data to the Request stream.
dataStream.Write(ByteArray, 0, ByteArray.Length)
' Close the Stream object.
dataStream.Close()
' Get the response.
Value = Instance.Status
Dim response As WebResponse = Request.GetResponse()
' Display the status.
Console.WriteLine(CType(response, HttpWebResponse).StatusDescription)
' Get the stream containing content returned by the server.
dataStream = response.GetResponseStream()
' Open the stream using a StreamReader for easy access.
Dim reader As New StreamReader(dataStream)
' Read the content.
Dim responseFromServer As String = reader.ReadToEnd()
TextBox1.Text += responseFromServer
' Clean up the streams.
reader.Close()
dataStream.Close()