Peter said:
Clarification of my above entry:
It is implied but not stated that I want a Ruby program that does the
same as my existing Java program.
Peter
Niko,
I guess all of the above. I have done a little with Ruby on Rails and
would like to use it, but don'r want to proceed until I solve this
problem. In my web searching I find documentation of several Ruby
protocol implementations but some are quite old.
The Java code looks like this:
String soapAction = args[0];
String sendmsg = soapAction+".xml";
String urlString = "
http://dealer.patagonia.com/za/PXM";
try {
URL url = new URL(urlString);
HttpURLConnection httpConnection =
(HttpURLConnection) url.openConnection();
httpConnection.setRequestProperty("SOAPAction", soapAction);
httpConnection.setDoOutput(true);
httpConnection.setDoInput(true);
httpConnection.setRequestMethod("POST");
httpConnection.setRequestProperty("Content-Type", "text/xml");
PrintStream httpout = new
PrintStream(httpConnection.getOutputStream());
BufferedReader in = new BufferedReader(new
InputStreamReader(fis));
/* Get first line of the outgoing message */
String line = in.readLine();
while (line != null) {
System.out.println(line);
/* Send the line to the http connection */
httpout.print(line);
line = in.readLine();
System.out.println("Reading the response stream ...");
BufferedReader in2 =
new BufferedReader(
new InputStreamReader(httpConnection.getInputStream()));
System.out.println("Response:");
String line = in2.readLine();
while (line != null) {
if (line.length() > 2)
System.out.println(line);
line = in2.readLine();
I have fumbled around with Ruby HTTP but am getting nowhere.
I would appreciate any direction you can give.
Peter