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
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,13 +41,13 @@ HTTP-RPC provides the following classes for implementing REST services:
41
41
*`ResourcePath` - annotation that associates a resource path with a service method
42
42
*`JSONEncoder` - class that serializes an object hierarchy to JSON
43
43
*`JSONDecoder` - class that deserializes an object hierarchy from JSON
44
-
*`WebServiceProxy` - web service invocation proxy
44
+
*`WebServiceProxy` - class for consuming remote web services
45
45
*`WebServiceException` - exception thrown when a service operation returns an error
46
46
*`org.httprpc.beans`
47
-
*`BeanAdapter` - adapter class that presents the contents of a Java Bean instance as a map
47
+
*`BeanAdapter` - class that presents the contents of a Java Bean instance as a map or vice versa
48
48
*`org.httprpc.sql`
49
-
*`ResultSetAdapter` - adapter class that presents the contents of a JDBC result set as an iterable sequence of maps or typed values
50
-
*`Parameters` - class for simplifying execution of prepared statements
49
+
*`ResultSetAdapter` - class that presents the contents of a JDBC result set as an iterable sequence of maps or typed values
50
+
*`Parameters` - class for applying named parameters values to prepared statements
51
51
52
52
These classes are explained in more detail in the following sections.
53
53
@@ -115,7 +115,7 @@ Method arguments may be any of the following types:
115
115
*`java.util.List`
116
116
*`java.net.URL`
117
117
118
-
As shown in the previous example, `List` arguments represent multi-value parameters. List values are automatically converted to their declared types (e.g. `List<Double>`).
118
+
As shown in the previous section, `List` arguments represent multi-value parameters. List values are automatically converted to their declared types (e.g. `List<Double>`).
119
119
120
120
`URL` arguments represent file uploads. They may be used only with `POST` requests submitted using the multi-part form data encoding. For example:
121
121
@@ -301,7 +301,7 @@ public class TreeNode {
301
301
}
302
302
```
303
303
304
-
An example service method that returns a `TreeNode` structure is shown below:
304
+
A service method that returns a `TreeNode` structure is shown below:
305
305
306
306
```java
307
307
@RequestMethod("GET")
@@ -355,7 +355,7 @@ Although the values are actually stored in the strongly typed properties of the
355
355
```
356
356
357
357
### TypedMapAccess
358
-
`BeanAdapter` can also be used to facilitate type-safe access to deserialized JSON data. For example, `JSONDecoder` would parse the content returned by the previous example into a graph of map and list values. The `adapt()` method of the `BeanAdapter` classcan be used to efficiently transform this loosely typed data structure into a strongly typed object hierarchy. This method takes an object (typically a map) and a result type as arguments, and returns an instance of the result type that adapts the underlying value.
358
+
`BeanAdapter` can also be used to facilitate type-safe access to deserialized JSON data. For example, `JSONDecoder` would parse the content returned by the previous example into a collection of map and list values. The `adapt()` method of the `BeanAdapter` classcan be used to efficiently transform this loosely typed data structure into a strongly typed object hierarchy. This method takes an object (typically a map) and a result type as arguments, and returns an instance of the result type that wraps the underlying value.
359
359
360
360
For example, given the following interfacedefinition:
361
361
@@ -556,9 +556,9 @@ public <T> T invoke() throws IOException { ... }
The first version automatically deserializes a successful server response using `JSONDecoder`.The second version allows a caller to provide a custom response handler.
559
+
The first version automatically deserializes a successful response using `JSONDecoder`.The second version allows a caller to provide a custom response handler.
560
560
561
-
If the server returns an error response, a `WebServiceException` will be thrown. If the content type of the response is "text/plain", the body of the response will be returned in the exception message.
561
+
If the server returns an error response, a `WebServiceException` will be thrown. The response code can be retrieved via the exception's `getStatus()` method. If the content type of the response is "text/plain", the body of the response will be returned in the exception message.
562
562
563
563
### Example
564
564
The following code snippet demonstrates how `WebServiceProxy` might be used to access the operations of the simple math service discussed earlier:
0 commit comments