I'm new to Java but trying to make a client that will connect and send SOAP request to a Server.
The script I'm trying to send works well via soapUI.
When I'm trying to use "my" client I'm getting following error:
"java.io.IOException: Server returned HTTP response code: 500 for URL: https://xxxxx/path-to-location at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)"
// Send Request to the server
DataOutputStream outStr = new DataOutputStream(connection.getOutputStream ());
outStr.writeBytes(command);
outStr.flush();
outStr.close();
// Get Response from the server
InputStream inputStream = connection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
String line;
while((line = reader.readLine()) != null) {
response.append(line);
response.append('\r');
logger.debug(line);
}
reader.close();
// Set the results
result = true;
rawXmlResult = new String(response);
}"
Here is my "command":
"<?xml version="1.0" encoding="UTF-8"?>
<ns2:myAction xmlns:cus="http://xxxxx/">
<buddy>
<name>John</name>
</buddy>
</ns2:myAction>
"