title: Call REST service from Apache Camel Blueprint
body: <p>I want to call external REST service that return a JSON, the REST itself have a basic authentication (which I don't know how to send a basic authentication), I've read some tutorial and also CXFRS component that lead me to this <code>blueprint.xml</code>.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:cxf="http://camel.apache.org/schema/cxf"
         xmlns:jaxrs="http://cxf.apache.org/jaxrs"
         xsi:schemaLocation="
         http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
         http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
         http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"&gt;
  
    &lt;bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider"/&gt;
  
    &lt;cxf:rsClient id="rsClient" address="http://localhost/test.php"&gt;
      &lt;cxf:providers&gt;
        &lt;ref bean="jsonProvider"/&gt;
      &lt;/cxf:providers&gt;
    &lt;/cxf:rsClient&gt;
  
    &lt;camelContext xmlns="http://camel.apache.org/schema/blueprint"&gt;
      &lt;propertyPlaceholder location="classpath:sql.properties" id="placeholder"/&gt;
  
      &lt;route&gt;
        &lt;from uri="cxfrs://bean://rsClient"/&gt;
        &lt;log message="${body}"/&gt;
      &lt;/route&gt;
  
    &lt;/camelContext&gt;
  
  &lt;/blueprint&gt;
  </code></pre>
  
  <p>If it's even relevant, I'm using JBoss Developer Studio to develop and to test  using right click on <code>blueprint.xml -&gt; Run As -&gt; Local Camel Context (without tests)</code> here is output from that.</p>
  
  <pre><code>[ERROR] *************************************
  [ERROR] Error occurred while running main from: org.apache.camel.test.blueprint.Main
  [ERROR] 
  java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:488)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.RuntimeException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext)
      at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:265)
      at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:226)
      at org.apache.camel.test.blueprint.Main.doStart(Main.java:110)
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
      at org.apache.camel.main.MainSupport.run(MainSupport.java:150)
      at org.apache.camel.main.MainSupport.run(MainSupport.java:354)
      at org.apache.camel.test.blueprint.Main.main(Main.java:84)
      ... 6 more
  [ERROR] *************************************
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 01:07 min
  [INFO] Finished at: 2016-10-04T12:11:28+07:00
  [INFO] Final Memory: 30M/314M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.camel:camel-maven-plugin:2.15.1.redhat-621084:run (default-cli) on project dsource: null: MojoExecutionException: InvocationTargetException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext) -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>Apart the error I got, how exactly I can call or invoke REST service from Apache Camel using Blueprint and get the returned JSON?</p>