kahlua001
Well-known member
Hi,
I have a webservice that has one method and takes in a string as a paramter, pretty simple. On my client app, I build the soap envelop and post it using HttpWebRequest but Im getting a Internal Server 500 Error, any clue to what im doing wrong? WSDL is not an option for me here.
I have a webservice that has one method and takes in a string as a paramter, pretty simple. On my client app, I build the soap envelop and post it using HttpWebRequest but Im getting a Internal Server 500 Error, any clue to what im doing wrong? WSDL is not an option for me here.
Code:
Dim strSoap As String
strSoap = "<?xml version=""1.0"" encoding=""utf-8""?>" & vbCrLf & _
"<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & vbCrLf & _
" <soap:Body>" & vbCrLf & _
" <submitCarriersStatus xmlns=""http://beta.webservices.netcour.com/fedex"">" & vbCrLf & _
" <strXML>" & str214 & "</strXML>" & vbCrLf & _
" </submitCarriersStatus>" & vbCrLf & _
" </soap:Body>" & vbCrLf & _
"</soap:Envelope>"
Dim req As HttpWebRequest = WebRequest.Create("http://tempuri/fedex/FedExStatusTest.asmx")
req.Headers.Add("SOAPAction", "http://tempuri/fedex/submitCarriersStatus")
req.Method = "POST"
req.Accept = "text/xml"
req.ContentLength = strSoap.Length
req.ContentType = "text/xml"
Dim sw As New StreamWriter(req.GetRequestStream)
sw.Write(strSoap)
sw.Close()
Dim resp As HttpWebResponse = req.GetResponse
Dim strResp As String = ""
Dim sr As New StreamReader(resp.GetResponseStream)
strResp = sr.ReadToEnd
sr.Close()