I need to send a raw SOAP request to server. My request looks like
POST http://10.76.243.43:8080/registry/services/xds-iti18 HTTP/1.1
Accept-Encoding: gzip,
Can you try like this: you need to replace the xmldata with yours:
try {
String xmldata = " your reuest";
String hostname = "10.76.243.43";
int port = 8080;
InetAddress addr = InetAddress.getByName(hostname);
Socket sock = new Socket(addr, port);
//Send header
String path = "registry/services/xds-iti18";
BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream(), "UTF-8"));
wr.write("POST "+path + " HTTP/1.1\r\n");
wr.write("Host: "+hostname+":"+port+"\r\n");
wr.write("Content-Length: "+ xmldata.length() + "\r\n");
wr.write("Content-Type: application/soap+xml; charset=\"utf-8\"\r\n");
wr.write("\r\n"); //Send data
wr.write(xmldata);
wr.flush();
// Response
BufferedReader rd = new BufferedReader(new InputStreamReader(sock.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
System.out.println("Response:"+line);
}
} catch (Exception e) {
e.printStackTrace();
}