uCosminexus Application Server, Web Service Development Guide
You use the cjclstartap command to start a Web resource client.
An example of starting the Web resource client is as follows:
> cd c:\temp\jaxrs\works\tutorial\client\ > "%COSMINEXUS_HOME%\CC\client\bin\cjclstartap" com.sample.client. SampleClient webhost 8085 |
When the cjclstartap command ends successfully, the execution result of the Web resource client is displayed. The following example describes the execution results of each method for developing a Web resource client:
KDJE40053-I The cjclstartap command will now start. (directory for the user definition file = c:\temp\jaxrs\works\tutorial\client, PID = 2636)
Demonstration 13 started.
This demonstrates how to use a Client API to receive a response as a ClientResponse.
This demonstrates usage of @Encoded at @CookieParam.
Automatic URI decoding should be disabled.
The target URL is "http://webhost:8085/tutorial/root/getCookieParam".
The HTTP method is "GET".
Connection and interaction ended successfully.
Response headers are {Transfer-Encoding=[chunked], Date=[Tue, 27 Dec 2011 0
7:59:41 GMT], Content-Type=[text/html], Server=[CosminexusComponentContainer]}.
Response entity is CookieParam: cookie%20value,
which means target resource completed the process described above without any problem.
Demonstration 13 ended successfully.
Demonstration 14 started.
This demonstrates how to send a ClientRequest and receive a ClientResponse by using Client#handle(ClientRequest request).
This demonstrates usage of @Consumes and @Produces.
The target URL is "http://webhost:8085/tutorial/root".
The HTTP method is "POST".
Connection and interaction ended successfully.
Response headers are {Transfer-Encoding=[chunked], Date=[Tue, 27 Dec 2011 0
7:59:41 GMT], Content-Type=[application/xml], Server=[CosminexusComponentContainer]}.
Response entity is <FormParam>formValue</FormParam>,
which means target resource completed the process described above without any problem.
Demonstration 14 ended successfully.
Demonstration 15 started.
This demonstrates JSON support of CJR.
This demonstrates POJO and JSON mapping.
The target URL is "http://webhost:8085/tutorial/root/PojoJsonMapping".
The HTTP method is "POST".
Connection and interaction ended successfully.
Response is Record [Name=New Record Name, Grades=[5, 6, 7]],
which means target resource completed the process described above without any problem.
Demonstration 15 ended successfully.
----- Successfully Ended -----
KDJE40054-I The cjclstartap command was stopped. (PID = 2636, exit status = 0)
|
KDJE40053-I The cjclstartap command will now start. (directory for the user definition file = c:\temp\jaxrs\works\tutorial\client, PID = 2636)
Demonstration 1 started.
This demonstrates injection of the javax.ws.rs.core.Request instance into the resource class field by using @Context.
The target URL is "http://webhost:8085/tutorial/root".
The HTTP method is "GET".
Connection and interaction ended successfully.
Response headers are {null=[HTTP/1.1 200 OK], Transfer-Encoding=[chunked], Date=[Tue, 27 Dec 2011 0
7:59:41 GMT], Content-Type=[text/html], Server=[CosminexusComponentContainer]}.
Response entity is RequestMethod: GET,
which means the target resource completed the process described above without any problem.
Demonstration 1 ended successfully.
Demonstration 2 started.
This demonstrates injection of QueryParam onto the resource bean setter method by using @QueryParam.
The target URL is "http://webhost:8085/tutorial/root/getQueryParam?queryParam=queryValue".
The HTTP method is "GET".
Connection and interaction ended successfully.
Response headers are {null=[HTTP/1.1 200 OK], Transfer-Encoding=[chunked], Date=[Tue, 27 Dec 2011 0
7:59:41 GMT], Content-Type=[text/html], Server=[CosminexusComponentContainer]}.
Response entity is QueryParameter: queryValue,
which means the target resource completed the process described above without any problem.
Demonstration 2 ended successfully.
----- Successfully Ended -----
KDJE40054-I The cjclstartap command was stopped. (PID = 2636, exit status = 0)
|
The part in Italics changes according to the execution time and environment.
For details on the cjclstartap command, see cjclstartap (Starting Java applications) in the uCosminexus Application Server Command Reference Guide.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.