Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 654607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:30:46+00:00 2026-05-13T22:30:46+00:00

I want to do the same that works previously on HTML but now via

  • 0

I want to do the same that works previously on HTML but now via .NET Windows Forms.

When I submit this HTML it works :

<html>
<head>
</head>
<body> 
<form name="TestForm" action="http://staging.csatravelprotection.com/ws/policyrequest" method="POST">
<input type="hidden" name="xmlrequeststring" value=" 
<quoterequest>
  <aff>COSTAMAR</aff> <!-- required -->
  <producer>10527930</producer> <!-- optional -->
  <productclass>85FL</productclass>  <!-- required -->
  <bookingreservno>0123456789AB</bookingreservno>  <!-- optional -->
  <numinsured>3</numinsured>  <!-- required -->
  <tripcost>5000.00</tripcost>  <!-- required -->
  <departdate>2010-11-01</departdate>  <!-- required -->
  <returndate>2010-11-20</returndate>  <!-- required -->
  <triptype>Cruise</triptype> <!-- optional -->
  <destination>Europe/ Mediterranean</destination>  <!-- required -->
  <supplier>Carnival Cruise Lines</supplier>  <!-- optional -->
  <airline>American</airline>  <!-- optional-->
  <travelers>
    <traveler>
      <age>45</age>  <!-- required -->
    </traveler>
    <traveler>
      <age>43</age>  <!-- required -->
    </traveler>
    <traveler>
      <age>15</age>  <!-- required -->
    </traveler>
  </travelers>
</quoterequest> 
">

<input type="submit" name="submit" value="submit">
</form> 
</body>
</html>

but when I try to send the XML via POST using .NET it appear to fail cause I dont know how to post via Hidden Input on the URI.

Imports System.IO
Imports System.Text
Imports System.Net
Public Class Form2
    Private Shared URL As String = "http://staging.csatravelprotection.com/ws/policyrequest"
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim oHttpWebRequest As WebRequest = WebRequest.Create(New Uri(URL))
        oHttpWebRequest.Method = "POST"
        oHttpWebRequest.ContentType = "text/xml"
        Dim oStream As Stream = oHttpWebRequest.GetRequestStream()
        Dim Reader As StreamReader = New StreamReader("C:\TEST.XML", Encoding.Default)
        Dim Postdata As String = String.Format("xmlrequeststring={0}", Reader.ReadToEnd)
        oStream.Write(Encoding.ASCII.GetBytes(Postdata), 0, Postdata.Length)
        oStream.Close()
        Dim oHttpWebResponse As HttpWebResponse = CType(oHttpWebRequest.GetResponse(), HttpWebResponse)
        Dim oStreamResponse As Stream = oHttpWebResponse.GetResponseStream()
        Dim oStreamRead As StreamReader = New StreamReader(oStreamResponse, Encoding.UTF8)
        Dim strReturnedXML As String = oStreamRead.ReadToEnd()

        MessageBox.Show(strReturnedXML)
        oStreamResponse.Close()
        oStreamRead.Close()
        oHttpWebResponse.Close()
    End Sub
End Class

XML :

<quoterequest>
  <aff>COSTAMAR</aff> 
  <producer>10527930</producer>
  <productclass>TBD</productclass>
  <bookingreservno>0123456789AB</bookingreservno> 
  <numinsured>3</numinsured>  
  <tripcost>5000.00</tripcost> 
  <departdate>2009-11-01</departdate>
  <returndate>2009-11-20</returndate>
  <initdate>2008-09-30</initdate>
  <finalpaymentdate>2008-10-30</finalpaymentdate> 
  <triptype>Cruise</triptype>
  <destination>Europe/ Mediterranean</destination> 
  <supplier>Carnival Cruise Lines</supplier>
  <airline>American</airline>
</quoterequest>

Is there a way to make it work as expected on .NET?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:30:46+00:00Added an answer on May 13, 2026 at 10:30 pm

    It is possible, but you should not post only the xml data, but the original html file with your xml data embedded.
    Het recieving page expects the data in that form. It cannot/does not see the difference between a browser or your program posting.

    It could be that they have a different url form posting xml format data.

    MarcelDevG

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a Windows Forms Application project using Visual Studio 2010. That being said:
i want to make to make an PreferenceActivity with the same style that can
i have a variable $cartTotal in cart.php page i want to use that same
I want to cache query results so that the same results are fetched for
I want to make sure that a set of functions have the same signature
I want to generate a Css that will be the same for all my
I want to make sure that all 3 conditions result in the same answer
I want to know that Filename1, provided by the user is the same as
I have multiple images that have the same class attribute and I want to
I have several lists in Matlab that I want to write to the same

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.