I'm trying to send a string from an XML to a ASP.NET web service, which will then convert that string to XML and saves it locally. I have everything working except for when I try to call the web service by the code below, I get the following error:
The remote server returned an error: (500) Internal Server Error.
Any ideas to hit the web service with the internal error message?
Thanks
The remote server returned an error: (500) Internal Server Error.
Try 'Loads the XML file and converts to string Dim rtnString As String rtnString = File.ReadAllText(ConfigurationManager.AppSettings("getXML"), Text.ASCIIEncoding.Default) 'Sends string to outside client's web service Dim url As String = "http://localhost/JAMIIS_rcv_FILE.asmx/receiveString" Dim postData As String = rtnString Dim objRequest As WebRequest = WebRequest.Create(url) objRequest.Method = "POST" objRequest.Credentials = CredentialCache.DefaultCredentials objRequest.ContentLength = postData.Length objRequest.ContentType = "text/plain" Dim postWriter As New StreamWriter(objRequest.GetRequestStream()) postWriter.Write(postData) postWriter.Close() Dim objResponse As WebResponse = objRequest.GetResponse() Dim sr As New StreamReader(objResponse.GetResponseStream()) Dim rawOutput As String = sr.ReadToEnd() sr.Close() Catch ex As Exception Response.Write(ex.Message) End Try
Any ideas to hit the web service with the internal error message?
Thanks
Last edited: