Solved

Invoke web servive With XML

Posted on 2010-09-19
1
476 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
Comment Utility
it looks like you have to add "SOAPAction" to the header of HttpWebRequest
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to trouble shoot .net contact form 3 30
Custom auto number 6 51
Hide Tab Page 3 18
Set form below another form 3 25
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to count occurrences of each item in an array.

744 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

16 Experts available now in Live!

Get 1:1 Help Now