Hi, i am trying to discover a way of creating a HTTP request in java. sending it and recieving the response in the code. I have to create an integration in my system with a 'web service' of sorts that returns XML from HTTP. I was going to grap the HTTP attributes from my page in a struts action class and then forward it on. Hopefully i can then block until i get the request of XML and then use that to create my next page on the fly. Does anybody know how this can be done. I am not sure if this is the best forum on JR but there are none more appropriate i believe. Cheers for any help. David
Well, I think you're handling this all wrong, but here's the code you asked for:
Personally, I think you'd be better off if you had the XML-ifier be a part of your web app. You realize that what you're doing is creating two requests for every request? This means that if your server can normally handle a load of about 1000 concurrent requests (I'm making up numbers here), then with your method you'd probably only be able to handle about half that, 500. Not a good idea.
Joined: Apr 24, 2001
Cheers, I think that is what i am looking for. You are completely right in the fact that this is not the best way for our app to go. Unfortunately we create a portal for a large client that intregrates with an number of mickey mouse web sites that provide 'web services'. They wish to use a HTTP server to take in a URL with params and return XML. we have to make the form on our site and post the results to a remote HTTP server. i want to be able to post in java code and get the 'XML request' in code so that i can pase the XML response to produce some type of HTML page to tell the user if the entered data is correct.Why oh why they wish to send a respose from HTTP back as xml this way i don't know. if they build cars as well as they create portals don't but japanese cars. Cheers, David
subject: Creating a HTTP request in java and getting it's request