Thanks Alex.

I'm still struggling upfront. I was copying your example and have combined the 
parts in one Blueprint DSL.

See my complete Blueprint DSL file below. I'm always getting a HTTP 404 (not 
found).

I'm assuming that the URL

https://localhost:8443/camel/api/say/hello

should be the one to call. Do I still miss something? Many thanks in advance.

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
           https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd";>

        <reference id="httpService" 
interface="org.osgi.service.http.HttpService" />

        <bean id="camelServlet" 
class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/>

        <bean 
class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer"
              init-method="register"
              destroy-method="unregister">
                <property name="servletName" value="MyServlet" />
                <property name="alias" value="/camel/api" />
                <property name="httpService" ref="httpService" />
                <property name="servlet" ref="camelServlet" />
        </bean>

        <bean id="httpRegistry" 
class="org.apache.camel.component.servlet.DefaultHttpRegistry" />

        <bean id="servlet" 
class="org.apache.camel.component.servlet.ServletComponent">
                <property name="httpRegistry" ref="httpRegistry" />
        </bean>

        <camelContext xmlns="http://camel.apache.org/schema/blueprint";>
                <restConfiguration
                        component="servlet"
                        bindingMode="json"
                        enableCORS="false"
                        skipBindingOnErrorCode="false"
                        clientRequestValidation="true">

                        <componentProperty key="matchOnUriPrefix" value="true" 
/>

                        <endpointProperty key="servletName" value="MyServlet" />
                        <endpointProperty key="disableStreamCache" value="true" 
/>

                        <dataFormatProperty key="contentTypeHeader" 
value="false" />
                        <dataFormatProperty key="baseUri" value ="/came/api" />
                </restConfiguration >

                <rest path="/say">
                        <get uri="/hello">
                                <to uri="direct:hello"/>
                        </get>
                </rest>

                <route>
                        <from uri="direct:hello"/>
                        <transform>
                                <constant>Hello World</constant>
                        </transform>
                </route>

        </camelContext>

</blueprint>

Best
- Gerald

> Alex Soto <alex.s...@envieta.com> hat am 14. Mai 2020 14:55 geschrieben:
> 
> 
> Hi Gerald,
> 
> I would put the Servlet in the same bundle; I don’t see the need to separate 
> it for reuse.
> Looks like you are missing security constraint in the 
> 'etc/org.ops4j.pax.web.context-admin.cfg' file
> 
> security.constraint.1.url = /camel/services/*
> security.constraint.1.method = *
> security.constraint.1.roles = admin
> 
> 
> Best regards,
> Alex soto
> 
> 
> 
> 
> 
> > On May 13, 2020, at 7:02 PM, Gerald Kallas <catsh...@mailbox.org> wrote:
> > <property name="alias" value="/camel/services" />
>

Reply via email to