I do not know if I can give you a copy of our code.
Here is example code using sockets; we wrote our own wrappers for this, instead of using a framework.
REQUEST: replace [hostName], [port], and [soapRequest], and this should be able to run a request.
Code:
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.net.InetAddress;
import java.net.Socket;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
Socket socket = null;
if (ssl) {
// Using SSL
SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
socket = (SSLSocket)
factory.createSocket(InetAddress.getByName([hostName]), [port]);
} else {
// Simple Socket
socket = new Socket(InetAddress.getByName([hostName]), [port]);
}
socket.setKeepAlive(true);
Writer writer = new BufferedWriter(
new OutputStreamWriter(socket.getOutputStream(), "UTF-8"));
writer.write([soapRequest]);
writer.flush(); RESPONSE: use the reader to get the header and contents.
Code:
import java.io.BufferedReader;
import java.io.InputStreamReader;
BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream());
Read entire header, finding line "Content-Length: #[#[#]]"
Get that length, as that is critical to knowing when to stop reading the response
Once you got the entire header, you need to read the contents for that exact # of characters. Note that I found there may be a couple of empty lines before the contents, and those do not counted for, so you may end up missing the last couple characters in the response.
If you need example SOAP, check out the following. Note that also includes Java code, may be helpful, but we chose to not use that.
[SOLVED] Java SOAP Request receiving service.UNKNOWN_DOCUMENT
Good Luck.