Karl Openet created CAMEL-8545:
----------------------------------

             Summary: Allow camel-swagger component to run in an internal 
container
                 Key: CAMEL-8545
                 URL: https://issues.apache.org/jira/browse/CAMEL-8545
             Project: Camel
          Issue Type: Improvement
          Components: camel-swagger
    Affects Versions: 2.14.1
         Environment: All
            Reporter: Karl Openet


I use camel as a front end to provide a RESTful API in front of a mix of 
various web services. Requests come in in either xml or json, and are converted 
to xml, transformed and sent on to the back end services which only support an 
RPC style.

I use rest dsl with configuration via spring xml, and it runs in a java process.

{noformat}
  <restConfiguration bindingMode="auto" component="jetty" host="localhost" 
port="18910"/>
{noformat}

I would love to use the camel-swagger component to provide a live API document 
of the Rest API's configured, but it seems that it is not possible without 
configuring a web.xml file.

Is this feasible? Is there an alternative to document the Rest API the camel 
context provides?

Camel-context below.

{noformat}
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:camel="http://camel.apache.org/schema/spring";
       xmlns:cxf="http://camel.apache.org/schema/cxf";
       xmlns:context="http://www.springframework.org/schema/context";
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context.xsd
       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://camel.apache.org/schema/cxf 
http://camel.apache.org/schema/cxf/camel-cxf.xsd";>
                  
  <import resource="classpath:META-INF/spring/jolokia.xml"/>    
                                                             
  <bean id="metricsRoutePolicyFactory" 
class="org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicyFactory"/>

  <camelContext xmlns="http://camel.apache.org/schema/spring";>

    <properties>
        <property key="CamelLogDebugBodyStreams" value="true"/>
   </properties>
    <propertyPlaceholder 
location="classpath:incident.properties,file:target/custom.properties" 
id="properties"/>
    
        <endpoint uri="jetty:http://localhost:28950/ig?bridgeEndpoint=true"; 
id="jsonEndpoint"/>
        <endpoint 
uri="cxf:http://localhost:28960/ig?dataFormat=PAYLOAD&amp;wsdlURL=http://localhost:28960/ig?WSDL&amp;loggingFeatureEnabled=true";
 id="soapEndpoint"/>         
        <dataFormats>
                <xmljson id="xmljson" forceTopLevelObject="true" 
removeNamespacePrefixes="true"/>
                <xmljson id="xmljsonWithOptions" trimSpaces="true" 
skipNamespaces="true"
             removeNamespacePrefixes="true"/>
        </dataFormats>
    <restConfiguration bindingMode="auto" component="jetty" host="localhost" 
port="18910"/>

  <rest path="/SubscriberProfilesJson/" consumes="application/json">
    <get uri="/{SubscriberId}">
      <to uri="direct:GetProfileJson"/>
    </get>
    <post uri="/{SubscriberId}/Subscriptions" consumes="application/json">
      <to uri="direct:CreateSubscriptionJson"/>
    </post>
    <get uri="/{SubscriberId}/Subscriptions" consumes="application/json">
      <to uri="direct:GetSubscriptionsJson"/>
    </get>
  </rest>
  
  <rest path="/SubscriberProfilesXml/" consumes="application/xml">
    <get uri="/{SubscriberId}">
      <to uri="direct:GetProfile"/>
    </get>
    <get uri="/{SubscriberId}/Subscriptions" consumes="application/xml">
      <to uri="direct:GetSubscriptions"/>
    </get>
    <post uri="/{SubscriberId}/Subscriptions" consumes="application/xml">
      <to uri="direct:CreateSubscription"/>
    </post>
  </rest>
  
  <rest path="/SubscriberProfilesJsonConvert/" consumes="application/json">
    <get uri="/{SubscriberId}/Subscriptions" consumes="application/json">
      <to uri="direct:GetSubscriptionsJsonConvert"/>
    </get>
  </rest>
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to