Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 I'm getting a Internal Server 500 Error, any clue to what i'm doing wrong? WSDL is not an option for me here.

 

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

Posted

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.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Posted
What I'm 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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...