Skip to Content

Access to Web Services Navigator with custom Java application

Hi.

I have a Web Services Navigator which works correctly in a browser and returns a value, based on a Context and Key. Now, I want to perform the same kind of query not in a browser, but in Java code, which will retrieve the data with request-response dialog.

In order to do that, I implemented a POST request:

URL url = new URL(HOST_DATA_SOURCE);

HttpURLConnection con = (HttpURLConnection) url.openConnection();

con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
con.addRequestProperty("Context", "%QRY_VAL_CONTEXT%");
con.addRequestProperty("Key", "%QRY_VAL_KEY%");

con.setDoOutput(true);

int responseCode = con.getResponseCode();

But when I execute it, I get a 404 response code. As far as I understand, I miss an authorization step, where my Java code proves, that it is allowed to perform such queries.


My question:
How can I implement an authorization to Web Services Navigator in my custom Java code?

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers