on 09-20-2018 10:19 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.