You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Eclipse and Intellij](#working-with-eclipse-and-intellij-idea)
37
41
*[License](#license)
@@ -114,6 +118,11 @@ you will have to create a service in [IBM Cloud][ibm_cloud].
114
118
If you are running your application in IBM Cloud (or other platforms based on Cloud Foundry), you don't need to specify the
115
119
credentials; the library will get them for you by looking at the [`VCAP_SERVICES`][vcap_services] environment variable.
116
120
121
+
## Running in IBM Cloud
122
+
123
+
When running in IBM Cloud (or other platforms based on Cloud Foundry), the library will automatically get the credentials from [`VCAP_SERVICES`][vcap_services].
124
+
If you have more than one plan, you can use `CredentialUtils` to get the service credentials for an specific plan.
125
+
117
126
## Getting the Service Credentials
118
127
119
128
You will need the `username` and `password` (`api_key` for Visual Recognition) credentials, and the API endpoint for each service. Service credentials are different from your IBM Cloud account username and password.
@@ -126,12 +135,6 @@ To get your service credentials, follow these steps:
126
135
1. On the left side of the page, click **Service Credentials**, and then **View credentials** to view your service credentials.
127
136
1. Copy `url`, `username` and `password`(`api_key` for AlchemyAPI or Visual Recognition).
128
137
129
-
## Changes for v4.0
130
-
Version 4.0 focuses on the move to programmatically-generated code for many of the services. See the [changelog](https://github.com/watson-developer-cloud/java-sdk/wiki/Changelog) for the details.
131
-
132
-
## Migration
133
-
This version includes many breaking changes as a result of standardizing behavior across the new generated services. Full details on migration from previous versions can be found [here](https://github.com/watson-developer-cloud/java-sdk/wiki/Migration).
134
-
135
138
## Android
136
139
137
140
The Android SDK utilizes the Java SDK while making some Android-specific additions. This repository can be found [here](https://github.com/watson-developer-cloud/android-sdk). It depends on [OkHttp][] and [gson][].
For more information see: [OkHTTPClient Proxy authentication how to?](https://stackoverflow.com/a/35567936/456564)
161
164
162
-
## Running in IBM Cloud
163
-
164
-
When running in IBM Cloud (or other platforms based on Cloud Foundry), the library will automatically get the credentials from [`VCAP_SERVICES`][vcap_services].
165
-
If you have more than one plan, you can use `CredentialUtils` to get the service credentials for an specific plan.
166
-
167
165
```java
168
166
PersonalityInsights service =newPersonalityInsights("2016-10-19");
Custom headers can be passed with any request. To do so, add the header to the `ServiceCall` object before executing the request. For example, this is what it looks like to send the header `Custom-Header` along with a call to the Watson Assistant service:
The basic `execute()`, `enqueue()`, and `rx()` methods make HTTP requests to your Watson service and return models based on the requested endpoint. If you would like access to some HTTP response information along with the response model, you can use the more detailed versions of those three methods: `executeWithDetails()`, `enqueueWithDetails()`, and `rxWithDetails()`. To capture the responses, use the new `Response<T>` class, with `T` being the expected response model.
184
+
185
+
Here is an example of calling the Watson Assistant `listWorkspaces()` method and parsing its response model as well as the response headers:
Make sure you are using the service credentials and not your IBM Cloud account/password.
206
245
Check the API Endpoint, you may need to update the default using `setEndPoint()`.
207
246
247
+
## Changes for v4.0
248
+
Version 4.0 focuses on the move to programmatically-generated code for many of the services. See the [changelog](https://github.com/watson-developer-cloud/java-sdk/wiki/Changelog) for the details. This version also includes many breaking changes as a result of standardizing behavior across the new generated services. Full details on migration from previous versions can be found [here](https://github.com/watson-developer-cloud/java-sdk/wiki/Migration).
249
+
208
250
## Debug
209
251
210
-
HTTP requests can be logging by adding a `loggging.properties` file to your classpath.
252
+
HTTP requests can be logged by adding a `logging.properties` file to your classpath.
0 commit comments