500 SERVER ERROR at idempiere web service connection#getInputStream()

109 views
Skip to first unread message

loghes...@konnectbi.com

unread,
Aug 6, 2018, 2:37:21 AM8/6/18
to iDempiere

HI,
   While doing web service connection.getInputStream() given server error for http://localhost:6050/ADInterface/services/ModelADService but its return output for any other URL input.

Exception is,
       java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:6050/ADInterface/services/ModelADService

Please anyone let me give solution

Thanks in advance,
Loghes
 

loghes...@konnectbi.com

unread,
Aug 6, 2018, 5:06:48 AM8/6/18
to iDempiere
      HI, I am using the following code,
                                URL u = new URL(getWebServiceUrl());
URLConnection uc = null;

if (proxy != null)
uc = u.openConnection(proxy);
else
uc = u.openConnection();

HttpURLConnection connection = (HttpURLConnection) uc;
connection.setRequestMethod(getRequestMethod());
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setUseCaches(false);
connection.setRequestProperty("Content-Type", getContentType());
connection.setRequestProperty("User-Agent", getUserAgent());
connection.setConnectTimeout(getTimeout());
connection.setReadTimeout(getTimeout());

OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream(), CHARSET_UTF8);
out.write(dataRequest);
out.flush();
out.close();

BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), CHARSET_UTF8));
String inString;
while ((inString = in.readLine()) != null) {
dataResponse += inString;
}
in.close();
connection.disconnect();

Carlos Antonio Ruiz Gomez

unread,
Aug 6, 2018, 5:54:14 AM8/6/18
to idem...@googlegroups.com
Hi, sorry, no time to check your issue, but as advice you can use the library published by Saul at http://wiki.idempiere.org/en/Web_Services_Clients

Regards,

Carlos Ruiz
--
Reply all
Reply to author
Forward
0 new messages