Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Invoke web servive With XML

Posted on 2010-09-19
1
Medium Priority
?
489 Views
Last Modified: 2013-11-19
I am trying to this xml with given code to web service end point but it is now working giving 500 web internal error why this happens
Sub Main()
        SndXML("http://dgpys.teias.gov.tr:80/dgpys/services/EVDServis", "lgn.xml")
        Console.Read()
    End Sub
    Sub SndXML(ByVal URL As String, ByVal fn As String)
        Dim strURL As String = URL
        Dim xmlDoc As XmlDocument = New XmlDocument()
        xmlDoc.Load(fn)
        Dim request As HttpWebRequest = WebRequest.Create(strURL)
        request.Method = "POST"
        request.ContentType = "text/xml"
        request.Timeout = 30 * 1000
        Dim request_stream As Stream = request.GetRequestStream()
        xmlDoc.Save(request_stream)
        request_stream.Close()
        Dim response As HttpWebResponse = request.GetResponse()
        Dim r_stream As Stream = response.GetResponseStream()
        Dim response_stream As New StreamReader(r_stream, System.Text.Encoding.GetEncoding("utf-8"))
        Dim sOutput As String = response_stream.ReadToEnd()
        Console.Write(sOutput)
    End Sub

Open in new window

Lgn.xml
0
Comment
Question by:3XLcom
1 Comment
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 2000 total points
ID: 33714054
it looks like you have to add "SOAPAction" to the header of HttpWebRequest
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question