When invoking the URLConnection POST request on the Java backend, the browser test (ASMX) is normal, and the Java back-end returns the server returned HTTP response code:500 for URL:
Problem reason after carefully checking URL and request parameters
1 could be a coding problem.
2 need to set the following content
Conn.setrequestproperty ("Connection", "keep-alive");
Conn.setrequestproperty ("Charset", "GBK");
Set File type: Form submission Key-value
Conn.setrequestproperty ("Content-type", "application/x-www-form-urlencoded; CHARSET=GBK");
Set Receive type otherwise return 415 error
Conn.setrequestproperty ("Accept", "*/*") here for Brute force method settings Accept all types, in order to guard against returning 415;
conn.setrequestproperty ("User-agent", "mozilla/4.0" (compatible; MSIE 5.0; Windows NT; Digext) ");
Send POST request must be set as follows two lines
Conn.setdooutput (TRUE);
Conn.setdoinput (TRUE);
After setting, request again, normal call.