Internal 500 Server Error Soap Message

kahlua001

Well-known member
Joined
Dec 15, 2003
Messages
507
Location
los angeles
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.

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()
 
It sounds like you may have friendly http errors enabled. Try going to (Internet Explorer)

Tools -> Options -> Advanced -> Disable Friendly HTTP errors

that should give more detailed information than just internal server error.
 
Can you step through the web service code in a debugger? If so see where it fails as a 500 error is a bit vague as to the problem itself.
Also, just out of curiosity more than anything, is there a reason why WSDL isnt an option?
 
What Im doing is trying to use a wsdl from a web service on a Tibco server. The company who owns that Tibco server sent me a wsdl which .Net does not like, all sorts of name space errors and datatype missing errors which I tried to adapt to .Net friendly stuff, but in the end, wasted too much time and not getting it just right. So we dumped the idea and I went straight to constructing the soap message and sending them the data via a HttpWebRequest. On a side note, does anybody know of any differences between Java world wsdl and Microsoft world wsdl? You would think this should be universal...
 
Back
Top