Solved

Invoke web servive With XML

Posted on 2010-09-19
1
480 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 500 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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

756 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