Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6BD16200B41 for ; Thu, 7 Jul 2016 18:47:37 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6A5FF160A68; Thu, 7 Jul 2016 16:47:37 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8C199160A4F for ; Thu, 7 Jul 2016 18:47:36 +0200 (CEST) Received: (qmail 34558 invoked by uid 500); 7 Jul 2016 16:47:35 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 34536 invoked by uid 99); 7 Jul 2016 16:47:35 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2016 16:47:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id D2C0B1812B4 for ; Thu, 7 Jul 2016 16:47:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Wcg-dD2JUgNN for ; Thu, 7 Jul 2016 16:47:33 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTP id DEA735FE65 for ; Thu, 7 Jul 2016 16:47:32 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 30366E0223 for ; Thu, 7 Jul 2016 16:47:32 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 56B613A044E for ; Thu, 7 Jul 2016 16:47:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r992265 - in /websites/production/cxf/content: cache/docs.pageCache docs/jaxrsclientspringboot.html Date: Thu, 07 Jul 2016 16:47:30 -0000 To: commits@cxf.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160707164731.56B613A044E@svn01-us-west.apache.org> archived-at: Thu, 07 Jul 2016 16:47:37 -0000 Author: buildbot Date: Thu Jul 7 16:47:30 2016 New Revision: 992265 Log: Production update by buildbot for cxf Modified: websites/production/cxf/content/cache/docs.pageCache websites/production/cxf/content/docs/jaxrsclientspringboot.html Modified: websites/production/cxf/content/cache/docs.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/cxf/content/docs/jaxrsclientspringboot.html ============================================================================== --- websites/production/cxf/content/docs/jaxrsclientspringboot.html (original) +++ websites/production/cxf/content/docs/jaxrsclientspringboot.html Thu Jul 7 16:47:30 2016 @@ -28,6 +28,16 @@ + + + + + + + @@ -107,7 +117,123 @@ Apache CXF -- JAXRSClientSpringBoot <td height="100%"> <!-- Content --> <div class="wiki-content"> -<div id="ConfluenceContent"></div> +<div id="ConfluenceContent"><p><style type="text/css">/*<![CDATA[*/ +div.rbtoc1467910017386 {padding: 0px;} +div.rbtoc1467910017386 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1467910017386 li {margin-left: 0px;padding-left: 0px;} + +/*]]>*/</style></p><div class="toc-macro rbtoc1467910017386"> +<ul class="toc-indentation"><li><a shape="rect" href="#JAXRSClientSpringBoot-Introduction">Introduction</a></li><li><a shape="rect" href="#JAXRSClientSpringBoot-Setup">Setup</a></li><li><a shape="rect" href="#JAXRSClientSpringBoot-EnablingWebClients">Enabling WebClients</a> +<ul class="toc-indentation"><li><a shape="rect" href="#JAXRSClientSpringBoot-Configuration">Configuration</a></li></ul> +</li><li><a shape="rect" href="#JAXRSClientSpringBoot-EnablingProxyClients">Enabling ProxyClients</a> +<ul class="toc-indentation"><li><a shape="rect" href="#JAXRSClientSpringBoot-Configuration.1">Configuration</a></li></ul> +</li></ul> +</div><h1 id="JAXRSClientSpringBoot-Introduction">Introduction</h1><p>This page describes how <a shape="rect" href="jax-rs-client-api.html">CXF JAX-RS Client</a> code can be used inside SpringBoot applications.</p><p>Please see a <a shape="rect" href="http://cxf.apache.org/docs/springboot.html#SpringBoot-SpringBootCXFJAX-RSStarter">CXF JAX-RS starter</a> section on how to enable JAX-RS endpoints.</p><h1 id="JAXRSClientSpringBoot-Setup">Setup</h1><p>If your SpringBoot Application depends on a <a shape="rect" href="http://cxf.apache.org/docs/springboot.html#SpringBoot-SpringBootCXFJAX-RSStarter">CXF JAX-RS starter</a> then no more dependencies are required.</p><p>If you'd like to run JAX-RS clients in a pure client-side SpringBoot Application then the following Maven pom should suffice in many cases:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 + http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>1.3.5.RELEASE</version> + </parent> + <artifactId>spring-boot-cxf-client-application</artifactId> + <groupId>org.apache.cxf.samples</groupId> + <version>3.1.7</version> + <name>Spring Boot CXF Client Application</name> + <description>Spring Boot CXF Client Application</description> + + <properties> + <cxf.version>3.1.7</cxf.version> + </properties> + <dependencies> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-client</artifactId> + <version>${cxf.version}</version> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <mainClass>sample.rs.client.SpringBootClientApplication</mainClass> + </configuration> + </plugin> + </plugins> + </build> +</project> +</pre> +</div></div><h1 id="JAXRSClientSpringBoot-EnablingWebClients">Enabling WebClients</h1><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package sample.rs.client; + +import org.apache.cxf.jaxrs.client.WebClient; +import org.apache.cxf.jaxrs.client.spring.EnableJaxRsWebClient; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +@SpringBootApplication +@EnableJaxRsWebClient +public class SpringBootClientApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringBootClientApplication.class, args); + } + + @Bean + CommandLineRunner initWebClientRunner(final WebClient webClient) { + + return new CommandLineRunner() { + + @Override + public void run(String... runArgs) throws Exception { + System.out.println(webClient.path("sayHello/ApacheCxfWebClientUser").get(String.class)); + } + }; + } + +}</pre> +</div></div><p> </p><h2 id="JAXRSClientSpringBoot-Configuration">Configuration</h2><p> </p><h1 id="JAXRSClientSpringBoot-EnablingProxyClients">Enabling ProxyClients</h1><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">package sample.rs.client; + +import org.apache.cxf.jaxrs.client.spring.EnableJaxRsProxyClient; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +import sample.rs.service.HelloService; + +@SpringBootApplication +@EnableJaxRsProxyClient +public class SpringBootClientApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringBootClientApplication.class, args); + } + + @Bean + CommandLineRunner initProxyClientRunner(final HelloService client) { + + return new CommandLineRunner() { + + @Override + public void run(String... runArgs) throws Exception { + System.out.println(client.sayHello("ApacheCxfProxyUser")); + } + }; + } +} +</pre> +</div></div><p> </p><h2 id="JAXRSClientSpringBoot-Configuration.1">Configuration</h2></div> </div> <!-- Content --> </td>