You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ff...@apache.org on 2023/04/28 18:52:29 UTC

[camel] branch camel-3.20.x updated: camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut()

This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch camel-3.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.20.x by this push:
     new 29466acea75 camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut()
29466acea75 is described below

commit 29466acea75d52c16523c82dfccbecd655d74a19
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Fri Apr 28 14:49:10 2023 -0400

    camel-cxf doc: use exchange.getMessage() instead of the deprecated exchange.getOut()
    
    (cherry picked from commit 93a1ba2ae62e4a5fb46a5e43f364b40cfb60a93d)
---
 .../camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc     | 6 +++---
 .../camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc       | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc
index 92d49e4ed20..74b83e2d5f2 100644
--- a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc
+++ b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc
@@ -352,13 +352,13 @@ Exchange exchange = template.send("direct://proxy", new Processor() {
 });
 
 // get the response message
-Customer response = (Customer) exchange.getOut().getBody();
+Customer response = (Customer) exchange.getMessage().getBody();
 
 assertNotNull(response, "The response should not be null");
 assertEquals(123, response.getId(), "Get a wrong customer id");
 assertEquals("John", response.getName(), "Get a wrong customer name");
-assertEquals(200, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE), "Get a wrong response code");
-assertEquals("value", exchange.getOut().getHeader("key"), "Get a wrong header value");
+assertEquals(200, exchange.getMessage().getHeader(Exchange.HTTP_RESPONSE_CODE), "Get a wrong response code");
+assertEquals("value", exchange.getMessage().getHeader("key"), "Get a wrong header value");
 ----
 
 The http://cxf.apache.org/docs/jax-rs.html[CXF JAXRS front end] also
diff --git a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc
index 915f518fc4a..59d4cfca254 100644
--- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc
+++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc
@@ -538,7 +538,7 @@ As an alternative you can add a message header for it as demonstrated in https:/
  // set up the response context which force start document
  Map<String, Object> map = new HashMap<String, Object>();
  map.put("org.apache.cxf.stax.force-start-document", Boolean.TRUE);
- exchange.getOut().setHeader(Client.RESPONSE_CONTEXT, map);
+ exchange.getMessage().setHeader(Client.RESPONSE_CONTEXT, map);
 -------------------------------------------------------------------
 
 == How to override the CXF producer address from message header
@@ -856,7 +856,7 @@ code in the message header as demonstrated by https://github.com/apache/camel/bl
 from(routerEndpointURI).process(new Processor() {
 
     public void process(Exchange exchange) throws Exception {
-        Message out = exchange.getOut();
+        Message out = exchange.getMessage();
         // Set the message body with the
         out.setBody(this.getClass().getResourceAsStream("SoapFaultMessage.xml"));
         // Set the response code here
@@ -892,7 +892,7 @@ response context with the following code:
                  exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, GREET_ME_OPERATION);
              }
          });
-         org.apache.camel.Message out = exchange.getOut();
+         org.apache.camel.Message out = exchange.getMessage();
          // The output is an object array, the first element of the array is the return value
          Object\[\] output = out.getBody(Object\[\].class);
          LOG.info("Received output text: " + output\[0\]);