473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

HTTP POST from a Web Service

I have an ASP.NET Web Service which receives an XMLDocument which is then
parsed. The values in the XML file need to be sent to a Java servlet on
another web server. How would I initiate an HTTP Post to the servlet from the
ASP.NET web service?

Many thanks for your assistance!
Nov 23 '05 #1
3 3061
Hi Chris

You can try httpWebRequest

HttpWebRequest req = (HttpWebRequest)HttpWebRequest .Create(http://myurl) ;

I assume you will pass the parameters on the URL or using headers ?

Eitherway, this class might help
You can then use

HttpWebResponse resp = (HttpWebResponse)req.GetResponse() ;

StreamReader sr = new StreamReader(resp.GetResponseStream,Encoding.ASCII );

Console.WriteLine(sr.ReadToEnd())
sr.Close();

To read the results back or something.

Hope this helps
Henk


"Chris Harris" <Ch*********@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
I have an ASP.NET Web Service which receives an XMLDocument which is then
parsed. The values in the XML file need to be sent to a Java servlet on
another web server. How would I initiate an HTTP Post to the servlet from
the
ASP.NET web service?

Many thanks for your assistance!

Nov 23 '05 #2
Thanks Hank, that's just what I needed!

"Henk Verhoeven" wrote:
Hi Chris

You can try httpWebRequest

HttpWebRequest req = (HttpWebRequest)HttpWebRequest .Create(http://myurl) ;

I assume you will pass the parameters on the URL or using headers ?

Eitherway, this class might help
You can then use

HttpWebResponse resp = (HttpWebResponse)req.GetResponse() ;

StreamReader sr = new StreamReader(resp.GetResponseStream,Encoding.ASCII );

Console.WriteLine(sr.ReadToEnd())
sr.Close();

To read the results back or something.

Hope this helps
Henk


"Chris Harris" <Ch*********@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
I have an ASP.NET Web Service which receives an XMLDocument which is then
parsed. The values in the XML file need to be sent to a Java servlet on
another web server. How would I initiate an HTTP Post to the servlet from
the
ASP.NET web service?

Many thanks for your assistance!


Nov 23 '05 #3
Thanks Hank - that's just what I needed!

"Henk Verhoeven" wrote:
Hi Chris

You can try httpWebRequest

HttpWebRequest req = (HttpWebRequest)HttpWebRequest .Create(http://myurl) ;

I assume you will pass the parameters on the URL or using headers ?

Eitherway, this class might help
You can then use

HttpWebResponse resp = (HttpWebResponse)req.GetResponse() ;

StreamReader sr = new StreamReader(resp.GetResponseStream,Encoding.ASCII );

Console.WriteLine(sr.ReadToEnd())
sr.Close();

To read the results back or something.

Hope this helps
Henk


"Chris Harris" <Ch*********@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
I have an ASP.NET Web Service which receives an XMLDocument which is then
parsed. The values in the XML file need to be sent to a Java servlet on
another web server. How would I initiate an HTTP Post to the servlet from
the
ASP.NET web service?

Many thanks for your assistance!


Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad...
17
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call...
3
by: Geoff | last post by:
I have been asked to add postal rates to a web page shopping cart checkout procedure. After contacting the post office I discovered that they used XML to receive postal rate requests and send back...
6
by: JK | last post by:
Can anyone provide me with an ASP 2.0 example of how to call the geocoder service. They provide the following perl example for XML-RPC : #!/usr/bin/perl use XMLRPC::Lite; use Data::Dumper;...
0
by: DT | last post by:
I'm writing a .NET 1.1 client that invokes a method of a Web Service running on another organization's IIS 5 server. I need help understanding a fine point about HTTP, specifically in relation to...
5
by: David Lozzi | last post by:
Howdy, I wrote a web service in .Net for my customer. My customer has another vendor who now has to consume it but they are not using Visual Studio. Most of their pages are jsp, and they said...
0
by: SimonDev | last post by:
Hi I've got an unusual problem I'm hoping someone could advise me on, regarding the formatting of the body of an HTTP response from a web service. We are using HTTP POST rather than SOAP for...
3
by: Jason Zhou | last post by:
I understand how to consume a web service by registering it as a web reference in my project, but how to use HTTP Post to call a web service? For example I have a web service called TestService,...
6
by: Brybot | last post by:
I am trying to allow HTTP POST file uploads to my web service. Currently I have it working perfectly for a SOAP/XML request reading in a byte using MemoryStream/FileStream but I cannot figure out...
5
by: Thomas Lunsford | last post by:
I have been asked to allow one of our old-school .asp pages to support being used as a web service. Specifically, WSDL was mentioned. I am not an expert on this , but I have done quite a bit of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.