cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Server output as a result of the CustomInvoker and Client output after parameterization refactoring of Client, CustomerService, and Order
Date Thu, 12 May 2011 09:17:42 GMT
Hi Ryan

Brilliant, you are moving fast now.
So, as agreed, customize the demo a bit more (add two jaxrs endpoints,
use subresource locator for the 2nd endpoint which uses Customer as
the root resource), make sure you can use request URIs from Java and
browser clients, including the case where custom ExceptionMappers
customize the response, and register your own implementation of
per-request resource provider for the 2nd endpoint. I think you'll
feel much more confident about the whole project once you are done
with this task. And yes, post me a Maven based project :-), we'll need
to use Maven later on anyway

Cheers, Sergey

On Thu, May 12, 2011 at 9:31 AM, Ryan Zoerner <ryanzoerner@gmail.com> wrote:
> This is follow-up info to the things that I discussed here:
> http://cxf.547215.n5.nabble.com/Basic-Http-Demo-and-the-refactoring-that-I-did-in-the-course-of-figuring-out-how-it-worked-td4389413.html
>
> and here:
> http://cxf.547215.n5.nabble.com/demo-jaxrs-server-CustomInvoker-td4389484.html
>
> ------------------------------------------------
> Custom Invoker:
> ------------------------------------------------
> Here is the terminal output from the Server which has registered a
> CustomInvoker.
>
> The registration was done in Server.java
>
> here:
>
> Server.java
> --------------------------------------------------------------------------------------------------------
> ...
> sf.setInvoker(new CustomInvoker());
> ...
> --------------------------------------------------------------------------------------------------------
>
> and here is the new output:
>
> mvn -Pserver
> --------------------------------------------------------------------------------------------------------
>
> There are no tests to run.
>
> Results :
>
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
>
> [INFO]
> [INFO] >>> exec-maven-plugin:1.2:java (default) @ jax_rs_basic >>>
> [INFO]
> [INFO] <<< exec-maven-plugin:1.2:java (default) @ jax_rs_basic <<<
> [INFO]
> [INFO] --- exec-maven-plugin:1.2:java (default) @ jax_rs_basic ---
> product 323
> product 324
> product 325
> May 12, 2011 3:18:08 AM org.apache.cxf.endpoint.ServerImpl initDestination
> INFO: Setting the server's publish address to be http://localhost:9000/
> May 12, 2011 3:18:09 AM org.eclipse.jetty.util.log.Slf4jLog info
> INFO: jetty-7.3.1.v20110307
> May 12, 2011 3:18:09 AM org.eclipse.jetty.util.log.Slf4jLog info
> INFO: Started SelectChannelConnector@localhost:9000
> May 12, 2011 3:18:09 AM org.eclipse.jetty.util.log.Slf4jLog info
> INFO: started o.e.j.s.h.ContextHandler{,null}
> Server ready...
>
> ***
> The method about to be invoked
> by the CustomInvoker
> is named
> --->  getCustomerByID
> ***
>
> ----invoking getCustomer, Customer id is: 123
>
> ***
> The method about to be invoked
> by the CustomInvoker
> is named
> --->  getOrder
> ***
>
> ----invoking getOrder, Order id is: 223
> ----invoking getProduct with id: 323
>
> ***
> The method about to be invoked
> by the CustomInvoker
> is named
> --->  getOrder
> ***
>
> ----invoking getOrder, Order id is: 224
> ----invoking getProduct with id: 324
>
> ***
> The method about to be invoked
> by the CustomInvoker
> is named
> --->  getOrder
> ***
>
> ----invoking getOrder, Order id is: 225
> ----invoking getProduct with id: 325
>
> ***
> The method about to be invoked
> by the CustomInvoker
> is named
> --->  updateCustomer
> ***
>
> ----invoking updateCustomer, Customer name is: Mary
>
> ***
> The method about to be invoked
> by the CustomInvoker
> is named
> --->  addCustomer
> ***
>
> ----invoking addCustomer, Customer name is: Jack
> Server exiting
> S:\cxf\distribution\src\main\release\samples\jax_rs\basic>
> --------------------------------------------------------------------------------------------------------
>
>
> I thought that the firewall and administrative settings on this Windows
> operating system would prevent me from printing this, but it turns out
> that I was incorrect about that.
>
>
>
> ------------------------------------------------
> Client output with refactoring:
> ------------------------------------------------
> Also, so that you can see the results of the refactoring that I mentioned,
> I have also included the client output here:
>
> mvn -Pclient
> --------------------------------------------------------------------------------------------------------
>
> [INFO] Scanning for projects...
> ...
> [INFO] --- exec-maven-plugin:1.2:java (default) @ jax_rs_basic ---
> Sent HTTP GET request to query customer info
> http://localhost:9000/customerservice/customers/123
> <?xml version="1.0" encoding="UTF-8"
> standalone="yes"?><Customer><id>123</id><na
> me>John</name></Customer>
>
>
>
>
> Sent HTTP GET request to query sub resource product info
> http://localhost:9000/customerservice/orders/223/products/323
> <?xml version="1.0" encoding="UTF-8"
> standalone="yes"?><Product><description>pro
> duct 323</description><id>323</id></Product>
>
>
> Sent HTTP GET request to query sub resource product info
> http://localhost:9000/customerservice/orders/224/products/324
> <?xml version="1.0" encoding="UTF-8"
> standalone="yes"?><Product><description>pro
> duct 324</description><id>324</id></Product>
>
>
> Sent HTTP GET request to query sub resource product info
> http://localhost:9000/customerservice/orders/225/products/325
> <?xml version="1.0" encoding="UTF-8"
> standalone="yes"?><Product><description>pro
> duct 325</description><id>325</id></Product>
>
>
>
>
> Sent HTTP PUT request to update customer info
> Response status code: 200
> Response body:
>
>
>
> Sent HTTP POST request to add customer
> Response status code: 200
> Response body:
> <?xml version="1.0" encoding="UTF-8"
> standalone="yes"?><Customer><id>124</id><na
> me>Jack</name></Customer>
>
>
> S:\cxf\distribution\src\main\release\samples\jax_rs\basic>
> --------------------------------------------------------------------------------------------------------
>
>
> This was the output from the code that I showed, or at least approximately.
> I mention
> this because in my most recent iteration of changing the Client, I have been
> printing
> the url contents and url headers explicitly. This helped me figure out more
> about
> what seems to be the equivalence of an HTTP GET Request and a simple
> openURLConnection to, what else, a url.
>
> Ryan
>



-- 
Sergey Beryozkin

Application Integration Division of Talend
http://sberyozkin.blogspot.com

Mime
View raw message