Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

HTTP POST from a Web Service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Harris - 18 Mar 2005 17:21 GMT
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!
Henk Verhoeven - 18 Mar 2005 18:45 GMT
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

>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
[quoted text clipped - 3 lines]
>
> Many thanks for your assistance!
Chris Harris - 20 Mar 2005 14:27 GMT
Thanks Hank, that's just what I needed!

> Hi Chris
>
[quoted text clipped - 26 lines]
> >
> > Many thanks for your assistance!
Chris Harris - 20 Mar 2005 14:27 GMT
Thanks Hank - that's just what I needed!

> Hi Chris
>
[quoted text clipped - 26 lines]
> >
> > Many thanks for your assistance!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.