camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: CXF rest services on cxf generated pages
Date Sat, 27 Aug 2011 01:35:28 GMT
Hi,

If you just want to publish the CXF service through the web container, 
you need to use the relative path instead of full http address.
 From CXF 2.4.x, CXF will not create a new Jetty instance to serve as 
the HTTP engine.

For the question 3, you may need to check the configuration of your web 
container host address, it should work if your host address is 
"0.0.0.0:8080"

On 8/27/11 3:34 AM, Mick Knutson wrote:
> I started looking through that and it is going to help, but here are some
> observations that I found through more hacking:
>
> 1. The unit tests in the originally:
>
> from apache-camel-2.8.0\examples\camel-example-cxf\**
>
> This used these endpoint urls:
>
> public static final String SOAP_ENDPOINT_URI_2 = "cxf://
> http://localhost:9106/soap"
>              + "?serviceClass=com.comcast.ivr.integration.EventService";
>
> Which would seem to create a new jetty server and the wsdl was available at:
> http://localhost:9106/soap?wsdl
>
> but the Jetty page describing the services shows:
> http://localhost:8080/event-processor/serviceshttp://localhost:9106/soap
> which is not valid.
>
> 2. I switched to this url:
>
> public static final String SOAP_ENDPOINT_URI_2 = "cxf://*/EventService*"
>              + "?serviceClass=com.comcast.ivr.integration.EventService";
>
> then I could see the cxf service correct
> http://10.21.180.147:8080/event-processor/services/EventService
>
> and the wsdl at
> http://10.21.180.147:8080/event-processor/services/EventService?wsdl
>
>
> 3. I do have an issue with this as when I want to see the published services
> in the jetty cxf page:
>
>       * Works: http://10.21.180.147:8080/event-processor/services/
>       * Does not work: http://*127.0.0.1*:8080/event-processor/services/
>       * Does not work: http:/*/localhost*:8080/event-processor/services/
>
>
> So now with the new services being published to *8080/context/service/* I
> want to assume this is using the deployed server (Tomcat or Jetty) to
> publish and service the requests, NOT another jetty server inside the
> deployed server. Correct?
>
>
> ---
> Thank You…
>
> Mick Knutson, President
>
> BASE Logic, Inc.
> Enterprise Architecture, Design, Mentoring&  Agile Consulting
> p. (855) BASE-LOGIC: (227-3564-42)
> p. (478) BASE-LOGIC (227-3564-42)
> f. (855) BASE-LOGIC: (227-3564-42)
>
> Website: http://www.baselogic.com
> Blog: http://www.baselogic.com/blog/
> Linked IN: http://linkedin.com/in/mickknutson
> Twitter: http://twitter.com/mickknutson
> ---
>
>
>
> On Thu, Aug 25, 2011 at 9:05 PM, Willem Jiang<willem.jiang@gmail.com>wrote:
>
>> Hi,
>>
>> I did use soapUI to test the REST service before.
>> Can you take a look at the unit test[1] of the camel-cxfrs ?
>> It could be easy to test the service with simple HttpClient.
>>
>> [1] https://svn.apache.org/repos/**asf/camel/trunk/components/**
>> camel-cxf/src/test/java/org/**apache/camel/component/cxf/**
>> jaxrs/CxfRsRouterTest.java<https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsRouterTest.java>
>>
>>
>> On Fri Aug 26 04:40:40 2011, Mick Knutson wrote:
>>
>>> as per:
>>> http://camel.apache.org/book-**in-one-page.html<http://camel.apache.org/book-in-one-page.html>
>>>
>>> I am just not getting how the RS_ENDPOINT is mappable to external clients
>>> looking to execute this service:
>>>
>>> private static final String CXF_RS_ENDPOINT_URI =
>>> "cxfrs://http://localhost:**9000/rest?resourceClasses=org.**
>>> apache.camel.component.cxf.**jaxrs.testbean.**CustomerServiceResource<http://localhost:9000/rest?resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerServiceResource>
>>> ";
>>>
>>>
>>> Seems that the URL that is in the endpoint is the url that is used to
>>> publish the service but I am not able to send a request in from another
>>> client such as SoapUi.
>>>
>>> Has anyone gotten SoapUi to work with this type or JAX-RS services?
>>> If not, How else do you test this outside of a Unit Test?
>>>
>>> ---
>>> Thank You…
>>>
>>> Mick Knutson, President
>>>
>>> BASE Logic, Inc.
>>> Enterprise Architecture, Design, Mentoring&   Agile Consulting
>>> p. (855) BASE-LOGIC: (227-3564-42)
>>> p. (478) BASE-LOGIC (227-3564-42)
>>> f. (855) BASE-LOGIC: (227-3564-42)
>>>
>>> Website: http://www.baselogic.com
>>> Blog: http://www.baselogic.com/blog/
>>> Linked IN: http://linkedin.com/in/**mickknutson<http://linkedin.com/in/mickknutson>
>>> Twitter: http://twitter.com/mickknutson
>>> ---
>>>
>>>
>>>
>>> On Thu, Aug 25, 2011 at 2:50 PM, Mick Knutson<mknutson@baselogic.com**
>>>> wrote:
>>>
>>>   I have been working on this all day today again and not made any headway.
>>>> I
>>>> am looking for any help getting pointed into the right direction.
>>>>
>>>> I have been trying to understand how to test the services that I have
>>>> deployed via SoapUi but cannot seem to be able to send in a message to
>>>> the
>>>> cxfrs route. http://camel.apache.org/cxfrs.**html<http://camel.apache.org/cxfrs.html>
>>>>
>>>> I have been trying to understand creating a cxf server:
>>>> http://cxf.apache.org/docs/**developing-a-service.html<http://cxf.apache.org/docs/developing-a-service.html>
>>>>
>>>> Then trying to get access to a service that I have created:
>>>> http://camel.apache.org/cxf.**html<http://camel.apache.org/cxf.html>
>>>>
>>>> But I cannot seem to get past using the endpoints for testing from the
>>>> original example:
>>>>
>>>>      private static final String SOAP_ENDPOINT_URI_ORIG = "*cxf://
>>>> http://localhost:9006*/soap"
>>>>              +
>>>> "?serviceClass=org.apache.**camel.example.cxf.jaxrs.**
>>>> resources.BookStore";
>>>>      private static final String REST_ENDPOINT_URI_ORIG = "*cxfrs://
>>>> http://localhost:9002*/rest"
>>>>              +
>>>> "?resourceClasses=org.apache.**camel.example.cxf.jaxrs.**
>>>> resources.BookStoreImpl";
>>>>
>>>> Which is not what I want. I want to be able to get access to these
>>>> endpoints remotely.
>>>>
>>>> any help is greatly appreciated.
>>>>
>>>> ---
>>>> Thank You…
>>>>
>>>> Mick Knutson, President
>>>>
>>>> BASE Logic, Inc.
>>>> Enterprise Architecture, Design, Mentoring&   Agile Consulting
>>>> p. (855) BASE-LOGIC: (227-3564-42)
>>>> p. (478) BASE-LOGIC (227-3564-42)
>>>> f. (855) BASE-LOGIC: (227-3564-42)
>>>>
>>>> Website: http://www.baselogic.com
>>>> Blog: http://www.baselogic.com/blog/
>>>> Linked IN: http://linkedin.com/in/**mickknutson<http://linkedin.com/in/mickknutson>
>>>> Twitter: http://twitter.com/mickknutson
>>>> ---
>>>>
>>>>
>>>>
>>>> On Thu, Aug 25, 2011 at 2:45 PM, Mick Knutson<mknutson@baselogic.com**
>>>>> wrote:
>>>>
>>>>   I started with the example
>>>>> from apache-camel-2.8.0\examples\**camel-example-cxf\** and want to
>>>>> create a
>>>>> way to be able to:
>>>>>
>>>>> WHen I deploy that service then open
>>>>> http://localhost:8080/event-**processor/<http://localhost:8080/event-processor/>I
get the wrong URL's published:
>>>>>
>>>>> Available RESTful services:
>>>>> Endpoint address:
>>>>> http://localhost:8080/event-**processorhttp://localhost:**9102/rest<http://localhost:8080/event-processorhttp://localhost:9102/rest>
>>>>> WADL :
>>>>> http://localhost:8080/event-**processorhttp://localhost:**
>>>>> 9102/rest?_wadl&type=xml<http://localhost:8080/event-processorhttp://localhost:9102/rest?_wadl&type=xml>
>>>>> <http:**//localhost:8080/event-**processorhttp://localhost:**
>>>>> 9102/rest?_wadl&_type=xml<http://localhost:8080/event-processorhttp://localhost:9102/rest?_wadl&_type=xml>
>>>>>>
>>>>>
>>>>>
>>>>> Basically I am trying to access these services remotely now and want
to
>>>>> ensure I can validate the services that I have deployed.
>>>>>
>>>>>
>>>>> ---
>>>>> Thank You…
>>>>>
>>>>> Mick Knutson, President
>>>>>
>>>>> BASE Logic, Inc.
>>>>> Enterprise Architecture, Design, Mentoring&   Agile Consulting
>>>>> p. (855) BASE-LOGIC: (227-3564-42)
>>>>> p. (478) BASE-LOGIC (227-3564-42)
>>>>> f. (855) BASE-LOGIC: (227-3564-42)
>>>>>
>>>>> Website: http://www.baselogic.com
>>>>> Blog: http://www.baselogic.com/blog/
>>>>> Linked IN: http://linkedin.com/in/**mickknutson<http://linkedin.com/in/mickknutson>
>>>>> Twitter: http://twitter.com/mickknutson
>>>>> ---
>>>>>
>>>>>
>>>>
>>>>
>>
>>
>> --
>> Willem
>> ------------------------------**----
>> FuseSource
>> Web: http://www.fusesource.com
>> Blog:    http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(English)
>>         http://jnn.javaeye.com (Chinese)
>> Twitter: willemjiang Weibo: willemjiang
>>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Mime
View raw message