cancel
Showing results for 
Search instead for 
Did you mean: 

Access to Web Services Navigator with custom Java application

MikeB
Contributor
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Szabolcs_Renyo
Advisor
Advisor

Hi Mike,

I do not get the point of your question. The WS Navigator is a tool for testing web services. If you would like to call a ws you can call it directly from your code without the WS Navigator.

Best regards,
Szabolcs