Solved

Invoke web servive With XML

Posted on 2010-09-19
1
483 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
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…

734 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