diff --git a/SOAPClient.class b/SOAPClient.class deleted file mode 100644 index 8a8916404680f1c0eb3d5122d753913a363334cc..0000000000000000000000000000000000000000 Binary files a/SOAPClient.class and /dev/null differ diff --git a/SOAPClient.java b/SOAPClient.java deleted file mode 100644 index 5ce10b46e292cc0c392bcddac04bdaa7c59d7bc2..0000000000000000000000000000000000000000 --- a/SOAPClient.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * SOAPClient4XG. Read the SOAP envelope file passed as the second - * parameter, pass it to the SOAP endpoint passed as the first parameter, and - * print out the SOAP envelope passed as a response. with help from Michael - * Brennan 03/09/01 - * - * java SOAPClient4XG http://services.xmethods.net:80/soap/servlet/rpcrouter weatherreq.xml - * - * @author Bob DuCharme - * @version 1.1 - * @param SOAPUrl URL of SOAP Endpoint to send request. - * @param xmlFile2Send A file with an XML document of the request. - * - * 5/23/01 revision: SOAPAction added -*/ - -import java.io.*; -import java.net.*; - -public class SOAPClient { - public static void main(String[] args) throws Exception { - - if (args.length < 2) { - System.err.println("Usage: java SOAPClient4XG " + - "http://soapURL soapEnvelopefile.xml" + - " [SOAPAction]"); - System.err.println("SOAPAction is optional."); - System.exit(1); - } - - String SOAPUrl = args[0]; - String xmlFile2Send = args[1]; - - String SOAPAction = ""; - if (args.length > 2) - SOAPAction = args[2]; - - // Create the connection where we're going to send the file. - URL url = new URL(SOAPUrl); - URLConnection connection = url.openConnection(); - HttpURLConnection httpConn = (HttpURLConnection) connection; - - // Open the input file. After we copy it to a byte array, we can see - // how big it is so that we can set the HTTP Cotent-Length - // property. (See complete e-mail below for more on this.) - - FileInputStream fin = new FileInputStream(xmlFile2Send); - - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - - // Copy the SOAP file to the open connection. - copy(fin,bout); - fin.close(); - - byte[] b = bout.toByteArray(); - - // Set the appropriate HTTP parameters. - httpConn.setRequestProperty( "Content-Length", - String.valueOf( b.length ) ); - httpConn.setRequestProperty("Content-Type","text/xml; charset=utf-8"); - httpConn.setRequestProperty("SOAPAction",SOAPAction); - httpConn.setRequestMethod( "POST" ); - httpConn.setDoOutput(true); - httpConn.setDoInput(true); - - System.out.println("test111"+httpConn.toString()); - // Everything's set up; send the XML that was read in to b. - OutputStream out = httpConn.getOutputStream(); - out.write( b ); - out.close(); - - // Read the response and write it to standard out. - - InputStreamReader isr = - new InputStreamReader(httpConn.getInputStream()); - BufferedReader in = new BufferedReader(isr); - - String inputLine; - - while ((inputLine = in.readLine()) != null) - System.out.println(inputLine); - - in.close(); - } - - // copy method from From E.R. Harold's book "Java I/O" - public static void copy(InputStream in, OutputStream out) - throws IOException { - - // do not allow other threads to read from the - // input or write to the output while copying is - // taking place - - synchronized (in) { - synchronized (out) { - - byte[] buffer = new byte[256]; - while (true) { - int bytesRead = in.read(buffer); - if (bytesRead == -1) break; - out.write(buffer, 0, bytesRead); - } - } - } - } -} - diff --git a/SOAPClient.java.bak b/SOAPClient.java.bak deleted file mode 100644 index 10c86c1983614222d85e72d277fc19c8b4937af9..0000000000000000000000000000000000000000 --- a/SOAPClient.java.bak +++ /dev/null @@ -1,106 +0,0 @@ -/** - * SOAPClient4XG. Read the SOAP envelope file passed as the second - * parameter, pass it to the SOAP endpoint passed as the first parameter, and - * print out the SOAP envelope passed as a response. with help from Michael - * Brennan 03/09/01 - * - * java SOAPClient4XG http://services.xmethods.net:80/soap/servlet/rpcrouter weatherreq.xml - * - * @author Bob DuCharme - * @version 1.1 - * @param SOAPUrl URL of SOAP Endpoint to send request. - * @param xmlFile2Send A file with an XML document of the request. - * - * 5/23/01 revision: SOAPAction added -*/ - -import java.io.*; -import java.net.*; - -public class SOAPClient { - public static void main(String[] args) throws Exception { - - if (args.length < 2) { - System.err.println("Usage: java SOAPClient4XG " + - "http://soapURL soapEnvelopefile.xml" + - " [SOAPAction]"); - System.err.println("SOAPAction is optional."); - System.exit(1); - } - - String SOAPUrl = args[0]; - String xmlFile2Send = args[1]; - - String SOAPAction = ""; - if (args.length > 2) - SOAPAction = args[2]; - - // Create the connection where we're going to send the file. - URL url = new URL(SOAPUrl); - URLConnection connection = url.openConnection(); - HttpURLConnection httpConn = (HttpURLConnection) connection; - - // Open the input file. After we copy it to a byte array, we can see - // how big it is so that we can set the HTTP Cotent-Length - // property. (See complete e-mail below for more on this.) - - FileInputStream fin = new FileInputStream(xmlFile2Send); - - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - - // Copy the SOAP file to the open connection. - copy(fin,bout); - fin.close(); - - byte[] b = bout.toByteArray(); - - // Set the appropriate HTTP parameters. - httpConn.setRequestProperty( "Content-Length", - String.valueOf( b.length ) ); - httpConn.setRequestProperty("Content-Type","text/xml; charset=utf-8"); - httpConn.setRequestProperty("SOAPAction",SOAPAction); - httpConn.setRequestMethod( "POST" ); - httpConn.setDoOutput(true); - httpConn.setDoInput(true); - - // Everything's set up; send the XML that was read in to b. - OutputStream out = httpConn.getOutputStream(); - out.write( b ); - out.close(); - - // Read the response and write it to standard out. - - InputStreamReader isr = - new InputStreamReader(httpConn.getInputStream()); - BufferedReader in = new BufferedReader(isr); - - String inputLine; - - while ((inputLine = in.readLine()) != null) - System.out.println(inputLine); - - in.close(); - } - - // copy method from From E.R. Harold's book "Java I/O" - public static void copy(InputStream in, OutputStream out) - throws IOException { - - // do not allow other threads to read from the - // input or write to the output while copying is - // taking place - - synchronized (in) { - synchronized (out) { - - byte[] buffer = new byte[256]; - while (true) { - int bytesRead = in.read(buffer); - if (bytesRead == -1) break; - out.write(buffer, 0, bytesRead); - } - } - } - } -} - diff --git a/SOAPClient4XG.class b/SOAPClient4XG.class deleted file mode 100644 index a96b5ea6f55912f162f5cf3a201770773aec8b62..0000000000000000000000000000000000000000 Binary files a/SOAPClient4XG.class and /dev/null differ diff --git a/SOAPClient4XG.java b/SOAPClient4XG.java deleted file mode 100644 index ca0d38f4bdd4c464050f349effab2f9e7ada785c..0000000000000000000000000000000000000000 --- a/SOAPClient4XG.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * SOAPClient4XG. Read the SOAP envelope file passed as the second - * parameter, pass it to the SOAP endpoint passed as the first parameter, and - * print out the SOAP envelope passed as a response. with help from Michael - * Brennan 03/09/01 - * - * java SOAPClient4XG http://services.xmethods.net:80/soap/servlet/rpcrouter weatherreq.xml - * - * @author Bob DuCharme - * @version 1.1 - * @param SOAPUrl URL of SOAP Endpoint to send request. - * @param xmlFile2Send A file with an XML document of the request. - * - * 5/23/01 revision: SOAPAction added -*/ -import java.net.*; -import java.io.*; - -public class SOAPClient4XG { - - - public static void main(String[] args) throws Exception { - String SOAPUrl = "http://localhost:7777/"; -// String xmlFile2Send = args[1]; - -// String SOAPAction = ""; -// if (args.length > 2) -// SOAPAction = args[2]; -// - // Create the connection where we're going to send the file. - URL url = new URL(SOAPUrl); - URLConnection connection = url.openConnection(); - HttpURLConnection httpConn = (HttpURLConnection) connection; - - // Open the input file. After we copy it to a byte array, we can see - // how big it is so that we can set the HTTP Cotent-Length - // property. (See complete e-mail below for more on this.) - - // FileInputStream fin = new FileInputStream(xmlFile2Send); - - // ByteArrayOutputStream bout = new ByteArrayOutputStream(); - - // Copy the SOAP file to the open connection. -// copy(fin,bout); -// fin.close(); - -// byte[] b = bout.toByteArray(); - - // Set the appropriate HTTP parameters. - httpConn.setRequestProperty( "Content-Length", - "10" ); - httpConn.setRequestProperty("Content-Type","text/xml; charset=utf-8"); - httpConn.setRequestProperty("SOAPAction","listalignment"); - httpConn.setRequestMethod( "POST" ); - httpConn.setDoOutput(true); - httpConn.setDoInput(true); - - // Everything's set up; send the XML that was read in to b. -// OutputStream out = httpConn.getOutputStream(); - // out.write( b ); - // out.close(); - - // Read the response and write it to standard out. - - InputStreamReader isr = - new InputStreamReader(httpConn.getInputStream()); - BufferedReader in = new BufferedReader(isr); - - String inputLine; - - while ((inputLine = in.readLine()) != null) - System.out.println(inputLine); - - in.close(); - } - - // copy method from From E.R. Harold's book "Java I/O" - public static void copy(InputStream in, OutputStream out) - throws IOException { - - // do not allow other threads to read from the - // input or write to the output while copying is - // taking place - - synchronized (in) { - synchronized (out) { - - byte[] buffer = new byte[256]; - while (true) { - int bytesRead = in.read(buffer); - if (bytesRead == -1) break; - out.write(buffer, 0, bytesRead); - } - } - } - } -} - diff --git a/SOAPClient4XG.java.bak b/SOAPClient4XG.java.bak deleted file mode 100644 index 6e12614132cb785440f60a939a9d36726f7f51ba..0000000000000000000000000000000000000000 --- a/SOAPClient4XG.java.bak +++ /dev/null @@ -1,98 +0,0 @@ -/** - * SOAPClient4XG. Read the SOAP envelope file passed as the second - * parameter, pass it to the SOAP endpoint passed as the first parameter, and - * print out the SOAP envelope passed as a response. with help from Michael - * Brennan 03/09/01 - * - * java SOAPClient4XG http://services.xmethods.net:80/soap/servlet/rpcrouter weatherreq.xml - * - * @author Bob DuCharme - * @version 1.1 - * @param SOAPUrl URL of SOAP Endpoint to send request. - * @param xmlFile2Send A file with an XML document of the request. - * - * 5/23/01 revision: SOAPAction added -*/ -import java.net.*; -import java.io.*; - -public class SOAPClient4XG { - - - public static void main(String[] args) throws Exception { - String SOAPUrl = "http://localhost:7777/"; -// String xmlFile2Send = args[1]; - -// String SOAPAction = ""; -// if (args.length > 2) -// SOAPAction = args[2]; -// - // Create the connection where we're going to send the file. - URL url = new URL(SOAPUrl); - URLConnection connection = url.openConnection(); - HttpURLConnection httpConn = (HttpURLConnection) connection; - - // Open the input file. After we copy it to a byte array, we can see - // how big it is so that we can set the HTTP Cotent-Length - // property. (See complete e-mail below for more on this.) - - // FileInputStream fin = new FileInputStream(xmlFile2Send); - - // ByteArrayOutputStream bout = new ByteArrayOutputStream(); - - // Copy the SOAP file to the open connection. -// copy(fin,bout); -// fin.close(); - -// byte[] b = bout.toByteArray(); - - // Set the appropriate HTTP parameters. - httpConn.setRequestProperty( "Content-Length", - "10" ); - httpConn.setRequestProperty("Content-Type","text/xml; charset=utf-8"); - httpConn.setRequestProperty("SOAPAction","listalignment"); - httpConn.setRequestMethod( "POST" ); - httpConn.setDoOutput(true); - httpConn.setDoInput(true); - - // Everything's set up; send the XML that was read in to b. -// OutputStream out = httpConn.getOutputStream(); - // out.write( b ); - // out.close(); - - // Read the response and write it to standard out. - - InputStreamReader isr = - new InputStreamReader(httpConn.getInputStream()); - BufferedReader in = new BufferedReader(isr); - - String inputLine; - - while ((inputLine = in.readLine()) != null) - System.out.println(inputLine); - - in.close(); - } - - // copy method from From E.R. Harold's book "Java I/O" - public static void copy(InputStream in, OutputStream out) - throws IOException { - - // do not allow other threads to read from the - // input or write to the output while copying is - // taking place - - synchronized (in) { - synchronized (out) { - - byte[] buffer = new byte[256]; - while (true) { - int bytesRead = in.read(buffer); - if (bytesRead == -1) break; - out.write(buffer, 0, bytesRead); - } - } - } - } -} - diff --git a/soap-example.xml b/soap-example.xml deleted file mode 100644 index ba46893bfe78e60c98e38f3fa0792c4f528fec59..0000000000000000000000000000000000000000 --- a/soap-example.xml +++ /dev/null @@ -1,12 +0,0 @@ -<SOAP-ENV:Envelope - xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" - xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" - xmlns:xsd="http://www.w3.org/1999/XMLSchema" -> - <SOAP-ENV:Body> - <ns1:getTemp xmlns:ns1="urn:xmethods-Temperature" - SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> - <zipcode xsi:type="xsd:string">11217</zipcode> - </ns1:getTemp> - </SOAP-ENV:Body> -</SOAP-ENV:Envelope>