Solved

Invoke web servive With XML

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Put window Form inside tab page 10 33
VB.NET (2008) - Refactoring Question 2 19
VB.Net - Get ColumnNames of SQL Table 4 10
.NET 2008 VB and C# 6 27
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
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.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

786 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