### Install and Start Discovery Implementation Bundle Source: https://cxf.apache.org/dosgi-discovery-demo-page.html Installs and starts the discovery implementation bundle. This is a command-line operation. ```shell -> install http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-discovery-interface/1.2/cxf-dosgi-ri-samples-discovery-interface-1.2.jar -> start http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-discovery-impl/1.2/cxf-dosgi-ri-samples-discovery-impl-1.2.jar ``` -------------------------------- ### Install and Start Discovery Client Bundle Source: https://cxf.apache.org/dosgi-discovery-demo-page.html Installs and starts the discovery client bundle. This is a command-line operation. ```shell -> install http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-discovery-interface/1.2/cxf-dosgi-ri-samples-discovery-interface-1.2.jar -> start http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-discovery-client/1.2/cxf-dosgi-ri-samples-discovery-client-1.2.jar ``` -------------------------------- ### Install and Start CXF-DOSGi Single Bundle Source: https://cxf.apache.org/dosgi-discovery.html Install the OSGi Compendium bundle and the CXF-DOSGi single-bundle distribution, then start the distribution bundle. ```shell -> install http://repo1.maven.org/maven2/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar Bundle ID: 4 -> install http://www.apache.org/dist/cxf/dosgi/1.1/cxf-dosgi-ri-singlebundle-distribution-1.1.jar Bundle ID: 5 -> start 5 ... log messages ... -> ps START LEVEL 1 ID State Level Name [ 0] [Active ] [ 0] System Bundle (1.8.0) [ 1] [Active ] [ 1] Apache Felix Shell Service (1.2.0) [ 2] [Active ] [ 1] Apache Felix Shell TUI (1.2.0) [ 3] [Active ] [ 1] Apache Felix Bundle Repository (1.4.0) [ 4] [Resolved ] [ 1] osgi.cmpn (4.2.0.200908310645) [ 5] [Active ] [ 1] Distributed OSGi Distribution Software Single-Bundle Distribution (1.1) ``` -------------------------------- ### Start Greeter Implementation Bundle Source: https://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html Installs and starts the bundle containing the GreeterService implementation from Maven. ```bash start http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-greeter-impl/1.2/cxf-dosgi-ri-samples-greeter-impl-1.2.jar ``` -------------------------------- ### Start Greeter Interface Bundle Source: https://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html Installs and starts the bundle containing the GreeterService interface definition from Maven. ```bash start http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-greeter-interface/1.2/cxf-dosgi-ri-samples-greeter-interface-1.2.jar ``` -------------------------------- ### Install and Run Consumer Bundle Source: https://cxf.apache.org/dosgi-ds-demo-page.html Commands to install and start the consumer side of the demo in an Equinox OSGi instance. ```shell osgi> install http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-ds-interface/1.2/cxf-dosgi-ri-samples-ds-interface-1.2.jar Bundle id is 5 osgi> install http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-ds-client/1.2/cxf-dosgi-ri-samples-ds-client-1.2.jar Bundle id is 6 osgi> start 6 ``` -------------------------------- ### Install Greeter Demo Samples in Karaf Source: https://cxf.apache.org/dosgi-apache-karaf-feature.html Install the greeter interface and implementation samples for CXF-DOSGi. ```bash install -s mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-ri-samples-greeter-interface/1.8.0 install -s mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-ri-samples-greeter-impl/1.8.0 ``` -------------------------------- ### Felix Console Commands to Start Consumer Source: https://cxf.apache.org/dosgi-spring-dm-demo-page.html Commands to install and start the necessary bundles for the Spring DM consumer demo in a Felix OSGi container. ```bash -> start http://repo2.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-spring-dm-interface/1.2/cxf-dosgi-ri-samples-spring-dm-interface-1.2.jar -> start http://repo2.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-spring-dm-client/1.2/cxf-dosgi-ri-samples-spring-dm-client-1.2.jar ``` -------------------------------- ### Start ZooKeeper Server Source: https://cxf.apache.org/dosgi-discovery.html Run the ZooKeeper server using its provided script. Ensure ZooKeeper is installed first. ```shell $ bin/zkServer ... log messages ... 2009-06-10 13:23:27,288 [main:FileTxnSnapLog@198] - Snapshotting: 0 ``` -------------------------------- ### Build and Install CXF JAX-RS Project Source: https://cxf.apache.org/docs/jax-rs-maven-plugins.html Execute this command within the generated project directory to build the application and install it into the local Maven repository. This step compiles the code, packages the WAR, and starts an embedded Tomcat server for testing. ```bash ~/work/archetypes/simple$ mvn install [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Simple CXF JAX-RS webapp service using spring configuration 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ Downloading: http://repo1.maven.org/maven2/org/apache/cxf/cxf-rt-frontend-jaxrs/3.6.10/cxf-rt-frontend-jaxrs-3.6.10.pom ...... [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ simple --- [INFO] Compiling 2 source files to ~/work/archetypes/simple/target/classes [INFO] ...... [INFO] --- maven-war-plugin:2.1.1:war (default-war) @ simple --- ...... [INFO] Building war: ~/work/archetypes/simple/target/simple-1.0-SNAPSHOT.war [INFO] [INFO] --- cargo:1.10.25:start (start-tomcat) @ simple --- [INFO] Resolved container artifact org.codehaus.cargo:cargo-core-container-tomcat:jar:1.10.25 for container tomcat9x ...... [INFO] Dec 12, 2025 8:13:55 P.M. org.apache.coyote.AbstractProtocol init [INFO] INFO: Initializing ProtocolHandler ["http-nio-54592"] [INFO] Dec 12, 2025 8:13:55 P.M. org.apache.catalina.startup.Catalina load [INFO] INFO: Server initialization in [510] milliseconds [INFO] Dec 12, 2025 8:13:55 P.M. org.apache.catalina.core.StandardService startInternal [INFO] INFO: Starting service [Catalina] [INFO] Dec 12, 2025 8:13:55 P.M. org.apache.catalina.core.StandardEngine startInternal [INFO] INFO: Starting Servlet engine: [Apache Tomcat/9.0.111] [INFO] Dec 12, 2025 8:13:55 P.M. org.apache.catalina.startup.HostConfig deployWAR ...... [INFO] Dec 12, 2025 8:13:58 P.M. org.apache.coyote.AbstractProtocol start [INFO] INFO: Starting ProtocolHandler ["http-nio-54592"] [INFO] Dec 12, 2025 8:13:58 P.M. org.apache.catalina.startup.Catalina start [INFO] INFO: Server startup in [3147] milliseconds [INFO] Tomcat 9.0.111 started on port [54592] ...... ----------------------------------------------------- ``` -------------------------------- ### Starting Equinox Framework Source: https://cxf.apache.org/dosgi-multi-bundle-distribution.html Command to start the Eclipse Equinox OSGi framework with a specified configuration directory and enter the console. ```bash java -jar plugins/org.eclipse.osgi_3.6.2.R36x_v20110210.jar -console -configuration dosgi_conf osgi> ss ``` -------------------------------- ### Verify Running Bundles After Implementation Install Source: https://cxf.apache.org/dosgi-discovery-demo-page.html Lists the currently running bundles after installing the discovery implementation. This is a command-line operation. ```shell -> ps START LEVEL 1 ID State Level Name [ 0] [Active ] [ 0] System Bundle (1.8.0) [ 1] [Active ] [ 1] Apache Felix Shell Service (1.2.0) [ 2] [Active ] [ 1] Apache Felix Shell TUI (1.2.0) [ 3] [Active ] [ 1] Apache Felix Bundle Repository (1.4.0) [ 4] [Resolved ] [ 1] OSGi R4 Compendium Bundle (4.1.0) [ 5] [Active ] [ 1] Distributed OSGi Distribution Software Single-Bundle Distribution [ 6] [Active ] [ 1] Distributed OSGi Discovery Sample Interface Bundle [ 7] [Active ] [ 1] Distributed OSGi Discovery Sample Implementation Bundle ``` -------------------------------- ### Advanced Simple Server Configuration with Interceptors and Properties Source: https://cxf.apache.org/docs/simple-frontend-configuration.html This example demonstrates an advanced configuration for the CXF simple front end server, including the setup of interceptors and properties. It utilizes child elements like , , and . ```xml ``` -------------------------------- ### Configure Simple Frontend Service with Spring XML Source: https://cxf.apache.org/docs/simple-frontend.html Example of cxf-servlet.xml for configuring a Simple Frontend endpoint. This setup requires specific schema imports for Spring beans, SOAP, and Simple configurations. ```xml ``` -------------------------------- ### Install CXF Clustering Features and Bundles Source: https://cxf.apache.org/docs/using-cxf-and-failover-in-osgi-environment.html Installs necessary CXF features and bundles for clustering and failover, including sample applications and JSON/Qi4j libraries. Ensure these are installed before configuring failover clients. ```bash feature:install cxf-jaxws cxf-features-clustering install -s mvn:org.apache.cxf.samples/failover_server install -s mvn:org.apache.cxf.samples/failover_jaxws_osgi install -s wrap:mvn:org.codeartisans/org.json/20130213 install -s mvn:joda-time/joda-time/2.8.1 install -s mvn:org.qi4j.core/org.qi4j.core.functional/2.1 install -s mvn:org.qi4j.core/org.qi4j.core.api/2.1 install -s mvn:org.qi4j.core/org.qi4j.core.io/2.1 install -s mvn:org.qi4j.core/org.qi4j.core.spi/2.1 install -s mvn:org.qi4j.core/org.qi4j.core.bootstrap/2.1 install -s mvn:org.qi4j.library/org.qi4j.library.jmx/2.1 install -s mvn:org.qi4j.library/org.qi4j.library.circuitbreaker/2.1 ``` -------------------------------- ### WSDL to Service Example Source: https://cxf.apache.org/docs/wsdl-to-service.html An example of using the wsdl2service tool to generate a WSDL file for a SOAP transport service. ```bash wsdl2service -transport soap -e servicename -p portname -n bindingname HelloWorld.wsdl ``` -------------------------------- ### Installing Bundles in Felix Source: https://cxf.apache.org/dosgi-spring-dm-demo-page.html Commands to install the necessary CXF DOSGi Spring-DM demo bundles into the Felix OSGi container. ```bash -> start http://repo2.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-spring-dm-interface/1.2/cxf-dosgi-ri-samples-spring-dm-interface-1.2.jar -> start http://repo2.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-spring-dm-impl/1.2/cxf-dosgi-ri-samples-spring-dm-impl-1.2.jar ``` -------------------------------- ### Install CXF-DOSGi Features in Karaf Source: https://cxf.apache.org/dosgi-apache-karaf-feature.html Add the necessary feature repositories for Aries RSA and CXF-DOSGi, then install the CXF-DOSGi provider. ```bash feature:repo-add aries-rsa 1.9.0 feature:repo-add cxf-dosgi 1.8.0 feature:install cxf-dosgi-provider-cxf ``` -------------------------------- ### Start CXF DOSGi Distribution Source: https://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html Starts the CXF DOSGi (Distributed OSGi) runtime single-bundle distribution from its JAR file. ```bash start http://www.apache.org/dist/cxf/dosgi/1.2/cxf-dosgi-ri-singlebundle-distribution-1.2.jar ``` -------------------------------- ### Example GET Request for Public Client Authorization Source: https://cxf.apache.org/docs/jax-rs-oauth2.html This is an example of a GET request a public client might make to the Authorization Service to initiate the OAuth2 authorization code grant flow. It assumes the client is registered as public and does not have a client secret. ```http GET http://localhost:8080/services/social/authorize?client_id=mobileClient&response_type=code ``` -------------------------------- ### Service Implementation Example Source: https://cxf.apache.org/docs/developing-a-service.html Example implementation of a service interface with 'sayHi' and 'greetMe' operations. This demonstrates how to provide business logic and handle incoming messages. ```java package demo.hw.server; import org.apache.hello_world_soap_http.Greeter; @javax.jws.WebService(portName = "SoapPort", serviceName = "SOAPService", targetNamespace = "http://apache.org/hello_world_soap_http", endpointInterface = "org.apache.hello_world_soap_http.Greeter") public class GreeterImpl implements Greeter { public String greetMe(String me) { System.out.println("Executing operation greetMe"); System.out.println("Message received: " + me + "\n"); return "Hello " + me; } public String sayHi() { System.out.println("Executing operation sayHi\n"); return "Bonjour"; } } ``` -------------------------------- ### Start Second Tomcat Instance Source: https://cxf.apache.org/fediz-idp-10.html Script to start a second Tomcat instance by temporarily redefining CATALINA_HOME. Ensure the path points to your second Tomcat installation. ```shell CATALINA_HOME=/path/to/second/tomcat $CATALINA_HOME/bin/startup.sh ``` -------------------------------- ### Client: Get JSON with ObservableRxInvoker Source: https://cxf.apache.org/docs/jax-rs-rxjava.html Example of making a GET request to a JAX-RS service returning JSON and processing the response using ObservableRxInvoker. Requires JacksonJsonProvider and ObservableRxInvokerProvider. ```java import org.apache.cxf.jaxrs.rx2.client.FlowableRxInvoker; import org.apache.cxf.jaxrs.rx2.client.ObservableRxInvokerProvider; import org.apache.cxf.jaxrs.client.WebClient; import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import org.junit.Test; import java.util.LinkedList; import java.util.List; import static org.junit.Assert.assertEquals; public class Rx2ClientTest { private static final String PORT = System.getProperty("http.port"); @Test public void testGetHelloWorldJson() throws Exception { String address = "http://localhost:" + PORT + "/rx2/observable/textJson"; List providers = new LinkedList<>(); providers.add(new JacksonJsonProvider()); providers.add(new ObservableRxInvokerProvider()); WebClient wc = WebClient.create(address, providers); Observable obs = wc.accept("application/json") .rx(ObservableRxInvoker.class) .get(HelloWorldBean.class); Holder holder = new Holder(); obs.subscribe(v -> { holder.value = v; }); Thread.sleep(2000); assertEquals("Hello", holder.value.getGreeting()); assertEquals("World", holder.value.getAudience()); } // Dummy Holder class for the example static class Holder { public T value; } // Dummy HelloWorldBean class for the example static class HelloWorldBean { private String greeting; private String audience; public HelloWorldBean() {} public HelloWorldBean(String greeting, String audience) { this.greeting = greeting; this.audience = audience; } public String getGreeting() { return greeting; } public void setGreeting(String greeting) { this.greeting = greeting; } public String getAudience() { return audience; } public void setAudience(String audience) { this.audience = audience; } } } ``` -------------------------------- ### Setting up Felix Framework Source: https://cxf.apache.org/dosgi-multi-bundle-distribution.html Commands to unpack the CXF DOSGi distribution, append its configuration to Felix's config.properties, and start the Felix framework. ```bash tar -xzvf cxf-dosgi-ri-multibundle-distribution-1.4-SNAPSHOT-dir.tar.gz cat apache-cxf-dosgi-ri-1.4-SNAPSHOT/conf/felix.config.properties.append >> conf/config.properties java -jar bin/felix.jar ``` -------------------------------- ### MAC Authorization Header Example Source: https://cxf.apache.org/docs/jax-rs-oauth2.html An example of an HTTP GET request with the Authorization header formatted according to the MAC scheme, including the MAC ID, nonce, MAC signature, and timestamp. ```http GET /calendar HTTP/1.1 Host: localhost Accept: application/xml Authorization: MAC id="5b5c8e677413277c4bb8b740d522b378", nonce="di3hvdf8", mac="W7bdMZbv9UWOTadASIQHagZyirA=" ts="12345678" ``` -------------------------------- ### WSDL to SOAP Example Usage Source: https://cxf.apache.org/docs/wsdl-to-soap.html An example demonstrating how to generate a WSDL file with RPC style and literal use, specifying the port type, output file, and input WSDL. ```bash wsdl2soap -i GreetPortType -n http://apache.org/hello_world_doc_lit -o Greeting.wsdl -style rpc -use literal TestGreeting.wsdl ``` -------------------------------- ### Install Decanter for CXF Logging Integration Source: https://cxf.apache.org/docs/message-logging.html Install Karaf Decanter features for log collection and Elasticsearch appending to send CXF logs to an Elasticsearch instance. This setup enables centralized logging and analysis. ```bash feature:repo-add mvn:org.apache.karaf.decanter/apache-karaf-decanter/3.0.0-SNAPSHOT/xml/features feature:install decanter-collector-log decanter-appender-elasticsearch elasticsearch kibana ``` -------------------------------- ### Example Request to AuthorizationRequestService Source: https://cxf.apache.org/docs/jax-rs-oauth.html Shows the structure of a GET request made by a user's browser to the AuthorizationRequestService after being redirected. ```http Address: http://localhost:8080/services/social/authorize?oauth_token=6dfd5e52-236c-4939-8df8-a53212f7d2a2 Http-Method: GET Content-Type: Headers: {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8], Referer=[http://localhost:8080/services/forms/reservation.jsp], ...} ``` -------------------------------- ### Combining Command Line Arguments for Service Deployment Source: https://cxf.apache.org/docs/javascript.html Example demonstrating how to combine `-a` and `-b` arguments with `ServerApp` to deploy multiple services with specific addresses and a common base address. ```java java org.apache.cxf.js.rhino.ServerApp -b http://cxf.apache.org hello_world.jsx goodbye_moon.js -a http://cxf.apache.org/goodness chocolate.jsx ``` -------------------------------- ### WSDL to XML Tool Example Source: https://cxf.apache.org/docs/wsdl-to-xml.html An example demonstrating how to use the `wsdl2xml` tool to generate a WSDL with an XML binding for a specified port type and address. ```bash wsdl2xml -i GreetPortType -a address TestGreeting.wsdl ``` -------------------------------- ### Installing Greeter Interface and Client Bundles in Equinox Source: https://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html These commands install the Greeter service interface and client bundles into the Equinox framework. These bundles are required for the Greeter service consumer to function. ```osgi install http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-greeter-interface/1.2/cxf-dosgi-ri-samples-greeter-interface-1.2.jar ``` ```osgi install http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-greeter-client/1.2/cxf-dosgi-ri-samples-greeter-client-1.2.jar ``` -------------------------------- ### Build All Kits (Fast) Source: https://cxf.apache.org/building.html Builds all modules including distribution and samples quickly by combining the 'everything' and 'fastinstall' Maven profiles. ```bash $ mvn install -Peverything,fastinstall ``` -------------------------------- ### Client: Using ObservableRxInvoker with JSON Source: https://cxf.apache.org/docs/jax-rs-rxjava.html Example of a client making a GET request to a JAX-RS service that returns JSON, using ObservableRxInvoker for reactive handling. ```APIDOC ## GET /rx2/observable/textJson ### Description Retrieves a HelloWorldBean object as JSON using an Observable. ### Method GET ### Endpoint http://localhost:PORT/rx2/observable/textJson ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```java WebClient wc = WebClient.create(address, providers); Observable obs = wc.accept("application/json") .rx(ObservableRxInvoker.class) .get(HelloWorldBean.class); ``` ### Response #### Success Response (200) - **HelloWorldBean** (object) - The returned JSON object. #### Response Example ```json { "greeting": "Hello", "audience": "World" } ``` ``` -------------------------------- ### Starting Greeter Client Bundle in Equinox Source: https://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html This command starts the Greeter client bundle, which contains the service consumer logic. This action triggers the lookup and invocation of the remote Greeter service. ```osgi start 4 ``` -------------------------------- ### Example Request with OAuth Headers Source: https://cxf.apache.org/docs/jax-rs-oauth.html Illustrates the structure of an HTTP GET request to a JAX-RS resource, including the necessary Authorization header with OAuth parameters for authentication and signature. ```http Address: http://localhost:8080/services/user/calendar Http-Method: GET Headers: { Accept=[application/XML], Authorization=[OAuth oauth_signature_method= "HMAC-SHA1",                      oauth_consumer_key= "123456789",                      oauth_token= "abc15aca-2073-4bde-b1be-1a02dc7ccafe",                      oauth_version= "1.0",                      oauth_signature= "dU%2BhXPNFfFpX2sC74IOxzTjdVrY%3D"] } ``` -------------------------------- ### Equinox Configuration Example Source: https://cxf.apache.org/dosgi-multi-bundle-distribution.html An example snippet of an Equinox config.ini file, showing the auto-start instructions for OSGi bundles, including CXF DOSGi bundles. ```ini org.ops4j.pax.web.session.timeout=30 osgi.bundles=org.eclipse.osgi.services@start, `c:/apache-cxf-dosgi-ri-1.3/dosgi_bundles/geronimo-annotation_1.0_spec-1.1.1.jar@start, c:/apache-cxf-dosgi-ri-1.3/dosgi_bundles/geronimo-activation_1.1_spec-1.0.2.jar@start, ... and so on ... ``` -------------------------------- ### Configure OpenTelemetry Client-Side Interceptors Source: https://cxf.apache.org/docs/using-opentelemetry.html Example of configuring OpenTelemetry SDK, tracer provider, and OpenTelemetryClientFeature for JAX-WS client-side integration. This setup is required for tracing outgoing requests. ```java final SdkTracerProvider sdkTracerProvider = SdkTracerProvider.builder()...build(); final OpenTelemetry openTelemetry = OpenTelemetrySdk.builder().setTracerProvider(sdkTracerProvider)...buildAndRegisterGlobal(); final Tracer tracer = openTelemetry.getTracer("tracer"); final JaxWsProxyFactoryBean sf = new JaxWsProxyFactoryBean(); ... sf.getFeatures().add(new OpenTelemetryClientFeature(openTelemetry, tracer)); ... sf.create(); ``` -------------------------------- ### Configure OpenTelemetry Server-Side Interceptors Source: https://cxf.apache.org/docs/using-opentelemetry.html Example of configuring OpenTelemetry SDK, tracer provider, and OpenTelemetryFeature for JAX-WS server-side integration. This setup is required for tracing incoming requests. ```java final SdkTracerProvider sdkTracerProvider = SdkTracerProvider.builder()...build(); final OpenTelemetry openTelemetry = OpenTelemetrySdk.builder().setTracerProvider(sdkTracerProvider)...buildAndRegisterGlobal(); final Tracer tracer = openTelemetry.getTracer("tracer"); final JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); ... sf.getFeatures().add(new OpenTelemetryFeature(openTelemetry, tracer)); ... sf.create(); ``` -------------------------------- ### Plain Queries to FIQL Conversion Examples Source: https://cxf.apache.org/docs/jax-rs-search.html Demonstrates how to enable plain query expressions to be converted to FIQL. The examples show different query parameter combinations and their expected FIQL output. ```java // GET /search?a=a1&a=v2 String exp = searchContext.getSearchExpression(); assertEquals("(a==a1,a==a2)", exp); ``` ```java // GET /search?a=a1&b=b1 exp = searchContext.getSearchExpression(); assertEquals("(a==a1;b==b1)", exp); ``` ```java // GET /search?ageFrom=10&ageTill=20 String exp = searchContext.getSearchExpression(); assertEquals("(age=ge=10,age=le=20)", exp); ``` -------------------------------- ### Create JAX-RS Client with Credentials and Configuration Source: https://cxf.apache.org/docs/jax-rs-client-api.html This example shows how to create a JAX-RS proxy or WebClient by providing username, password, and a configuration file path. ```java BookStore proxy = JAXRSClientFactory.create("http://books", BookStore.class, "username", "password", "classpath:/config/https.xml"); WebClient client = WebClient.create("http://books", "username", "password", "classpath:/config/https.xml"); ``` -------------------------------- ### Root Resource Class Example Source: https://cxf.apache.org/docs/jax-rs-basics.html Demonstrates a typical JAX-RS root resource class with various HTTP methods and path parameters. This class handles requests starting from '/customerservice/'. ```java package demo.jaxrs.server; import java.util.HashMap; import java.util.Map; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; @Path("/customerservice/") @Produces("application/xml") public class CustomerService { public CustomerService() { } @GET public Customers getCustomers() { // ... } @GET @Path("/customers/{id}") @Produces("application/json") public Customer getCustomer(@PathParam("id") String id) { // ... } @PUT @Path("/customers/{id}") @Consumes("application/xml") public Response updateCustomer(@PathParam("id") Long id, Customer customer) { // ... } @POST @Path("/customers") public Response addCustomer(Customer customer) { // ... } @DELETE @Path("/customers/{id}/") public Response deleteCustomer(@PathParam("id") String id) { // ... } @Path("/orders/{orderId}/") public Order getOrder(@PathParam("orderId") String orderId) { // ... } } ``` -------------------------------- ### Trace OpenFeign Client with OpenTelemetry Source: https://cxf.apache.org/docs/using-opentelemetry.html This example demonstrates how to configure an OpenFeign client to use OpenTelemetry tracing. It utilizes the `unwrap` method of TracerContext to get the underlying Tracer and passes it to the TracingClient. ```java @GET @Path("/search") @Produces(MediaType.APPLICATION_JSON) public JsonObject search(@QueryParam("q") final String query, @Context final TracerContext tracing) throws Exception { final GoogleBooksApi api = Feign.builder() .client(new TracingClient(new ApacheHttpClient(), tracing.unwrap(Tracer.class))) .target(GoogleBooksApi.class, "https://www.googleapis.com"); final Response response = api.search(query); try (final Reader reader = response.body().asReader()) { return Json.createReader(reader).readObject(); } ``` -------------------------------- ### XSD to WSDL Example Usage Source: https://cxf.apache.org/docs/xsd-to-wsdl.html Demonstrates how to generate a WSDL file named 'Invoice.wsdl' with a specific target namespace from an 'Invoice.xsd' schema file. ```bash xsd2wsdl -t http://org.apache/invoice -n Invoice Invoice.xsd ``` -------------------------------- ### OAuth 1.0 Resource Access Request Source: https://cxf.apache.org/docs/jax-rs-oauth.html Example of a GET request to access user resources using an obtained access token. The access token is included in the Authorization header for signature calculation. ```http Address: http://localhost:8080/services/user/calendar Http-Method: GET Headers: { Accept=[application/XML], Authorization=[OAuth oauth_signature_method="HMAC-SHA1", oauth_consumer_key="123456789", oauth_token="abc15aca-2073-4bde-b1be-1a02dc7ccafe", oauth_version="1.0", oauth_signature="dU%2BhXPNFfFpX2sC74IOxzTjdVrY%3D"] } ``` -------------------------------- ### Starting Equinox OSGi Framework Source: https://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html This command starts the Equinox OSGi framework. It is used to launch the OSGi container for running the service consumer. ```bash java -jar plugins/org.eclipse.osgi_3.6.0.v20100517.jar -console ``` -------------------------------- ### Verify Running Bundles Source: https://cxf.apache.org/dosgi-discovery-demo-page.html Lists the currently running bundles to verify installation and startup. This is a command-line operation. ```shell -> ps START LEVEL 1 ID State Level Name [ 0] [Active ] [ 0] System Bundle (1.8.0) [ 1] [Active ] [ 1] Apache Felix Shell Service (1.2.0) [ 2] [Active ] [ 1] Apache Felix Shell TUI (1.2.0) [ 3] [Active ] [ 1] Apache Felix Bundle Repository (1.4.0) [ 4] [Resolved ] [ 1] OSGi R4 Compendium Bundle (4.1.0) [ 5] [Active ] [ 1] Distributed OSGi Distribution Software Single-Bundle Distribution [ 6] [Active ] [ 1] Distributed OSGi Discovery Sample Client Bundle [ 7] [Active ] [ 1] Distributed OSGi Discovery Sample Interface Bundle ``` -------------------------------- ### Asynchronous Client-Side JAX-RS Invocation with OpenTracing Source: https://cxf.apache.org/docs/using-opentracing.html Perform an asynchronous invocation of a JAX-RS client. This example highlights the client-side setup for asynchronous calls, which also requires span management across threads. ```Java final Future future = client .target( "http://localhost:8282/books" ) .request() .accept( MediaType.APPLICATION_JSON ) .async() .get(); ``` -------------------------------- ### Full Build Command Source: https://cxf.apache.org/dosgi-build.html Execute this command to perform a full clean install of the project. Requires JDK 8 and Maven 3. ```bash mvn clean install ``` -------------------------------- ### Register Providers Directly on the Bus Source: https://cxf.apache.org/docs/jaxrs-services-configuration.html Starting from CXF 2.7.2, providers can be registered directly on the bus using cxf:properties and shared among all providers using that bus. This example shows registering an ExceptionMapper. ```xml                                                                                 ``` -------------------------------- ### ZooKeeper Configuration File Example Source: https://cxf.apache.org/dosgi-discovery.html Place this content in a file named 'org.apache.cxf.dosgi.discovery.zookeeper.cfg' in the FileInstall 'load' directory to configure the ZooKeeper client. ```properties zookeeper.host = 127.0.0.1 ``` -------------------------------- ### JCL for Tomcat Service Setup on z/OS Source: https://cxf.apache.org/docs/running-a-service-in-tomcat-on-zos.html This JCL (Job Control Language) snippet requires customization with your specific JDK and Tomcat installation paths. It is used for setting up and running a service within Tomcat on z/OS. ```jcl // JOB ... // STEP EXEC PGM=... // ... (rest of JCL) ``` -------------------------------- ### Sample JCL for Running Tomcat on z/OS Source: https://cxf.apache.org/docs/running-a-service-in-tomcat-on-zos.html This JCL script is used to configure and start Tomcat under the control of JZOS on a z/OS system. Tailor the job card, PROCLIB, Java version, and directory paths according to your installation. ```JCL //TOMCAT  JOB   (),      //         CLASS=A,       //         MSGCLASS=X,    //         MSGLEVEL=(1,1), //         NOTIFY=&SYSUID, //         REGION=0M,     //         TIME=1440      //PROCLIB JCLLIB ORDER=JZOS.SYS1.PROCLIB                               //*                                                                    //********************************************************************* //*                                                                    //* Batch job to run Tomcat under JZOS                                 //*                                                                    //* Tailor the proc and job for your installation:                     //* 1.) Modify the Job card per your installation's requirements       //* 2.) Modify the PROCLIB card to point to JZOS proclib               //* 3.) Set VERSION='14' for Java 1.4 or VERSION='50' for Java 5       //* 4.) Set JAVA_HOME to point the location of the Java SDK            //* 5.) Set CATALINA_HOME to point to the shared Tomcat install dir    //* 6.) (Optional) set CATALINA_BASE to point to instance specific     //*     Tomcat base dir                                                //*                                                                    //********************************************************************* //*                                                                    //JAVA EXEC PROC=JVMPRC50, //* LOGLVL='+D',                                                       // JAVACLS='org.apache.catalina.startup.Bootstrap',                    // ARGS='start'                                                        //STDENV DD * ``` -------------------------------- ### Example RESTful Access via URIMappingInterceptor Source: https://cxf.apache.org/cve-2012-5633.html Illustrates how a REST client could access the 'DoubleIt' SOAP service using a GET request to a specific URL, demonstrating the pattern exploited by CVE-2012-5633. This bypasses WS-Security when WSS4JInInterceptor is used. ```http http://localhost:8080/DoubleItPort/DoubleIt&numberToDouble=20 ``` -------------------------------- ### OSGi Container Command Line - Bundle Installation Source: https://cxf.apache.org/dosgi-ds-demo-page.html Commands to install the interface and implementation bundles for the CXF DOSGi DS demo from a Maven repository into the OSGi container. ```bash osgi> install http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-ds-interface/1.2/cxf-dosgi-ri-samples-ds-interface-1.2.jar Bundle id is 5 osgi> install http://repo1.maven.org/maven2/org/apache/cxf/dosgi/samples/cxf-dosgi-ri-samples-ds-impl/1.2/cxf-dosgi-ri-samples-ds-impl-1.2.jar Bundle id is 6 osgi> start 6 ... log messages may appear ... ```