Solved

Invoke web servive With XML

Posted on 2010-09-19
1
477 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 500 total points
ID: 33714054
it looks like you have to add "SOAPAction" to the header of HttpWebRequest
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

896 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now