masato yamazaki
Lurker
Hello
Where I installed it on Android Oreo's device
The transmission result of WebService has changed.
There is no problem until Android nougat
In Android Oreo, specification of HttpURLConnection changed
Please tell me if you know the missing settings in the following sources.
----------------------------------------------------------------
HttpURLConnection connection;
URL targetUrl = "http://[hostname]/XXX/XXXX.asmx"
connection = (HttpsURLConnection) targetUrl.openConnection();
connection.setConnectTimeout(timeout);
connection.setReadTimeout(timeout);
connection.setInstanceFollowRedirects(false);
connection.setRequestMethod("POST");
connection.setUseCaches(false);
connection.setDoInput(true);
// create header
Map<String, String> headers = new HashMap<>();
headers.put("Content-Type", "application/soap+xml; charset=utf-8");
connection.setRequestProperty(header.getKey(), header.getValue());
// create body
String body =
"<?xml version='1.0' encoding='utf-8' ?>"
+
"<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">"
+
"<soap12:Body>"
+
"<XXXXXXXX xmlns="http://localhost/">"
+
"<inputParameters>value</inputParameters>"
+
"</SendUploadFileInfoList>"
+
"</soap12:Body>"
+
"</soap12:Envelope>";
byte[] postDataBytes = body.getBytes("UTF-8");
connection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
connection.getOutputStream().write(postDataBytes);
// connect
connection.connect();
int code = connection.getResponseCode();
Map<String, List<String>> header = connection.getHeaderFields();
--Hereinafter omitted...
Where I installed it on Android Oreo's device
The transmission result of WebService has changed.
There is no problem until Android nougat
In Android Oreo, specification of HttpURLConnection changed
Please tell me if you know the missing settings in the following sources.
----------------------------------------------------------------
HttpURLConnection connection;
URL targetUrl = "http://[hostname]/XXX/XXXX.asmx"
connection = (HttpsURLConnection) targetUrl.openConnection();
connection.setConnectTimeout(timeout);
connection.setReadTimeout(timeout);
connection.setInstanceFollowRedirects(false);
connection.setRequestMethod("POST");
connection.setUseCaches(false);
connection.setDoInput(true);
// create header
Map<String, String> headers = new HashMap<>();
headers.put("Content-Type", "application/soap+xml; charset=utf-8");
connection.setRequestProperty(header.getKey(), header.getValue());
// create body
String body =
"<?xml version='1.0' encoding='utf-8' ?>"
+
"<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">"
+
"<soap12:Body>"
+
"<XXXXXXXX xmlns="http://localhost/">"
+
"<inputParameters>value</inputParameters>"
+
"</SendUploadFileInfoList>"
+
"</soap12:Body>"
+
"</soap12:Envelope>";
byte[] postDataBytes = body.getBytes("UTF-8");
connection.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
connection.getOutputStream().write(postDataBytes);
// connect
connection.connect();
int code = connection.getResponseCode();
Map<String, List<String>> header = connection.getHeaderFields();
--Hereinafter omitted...