Skip to content

Commit

Permalink
[resolves wildfly-extras#2036] Add support for component xmlrpc
Browse files Browse the repository at this point in the history
[resolves wildfly-extras#2049] Add support for dataformat xmlrpc
  • Loading branch information
tdiesler committed Sep 15, 2017
1 parent b154906 commit 163c8c4
Show file tree
Hide file tree
Showing 17 changed files with 212 additions and 7 deletions.
2 changes: 1 addition & 1 deletion catalog/src/main/resources/component.roadmap
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ velocity
vertx
vm
weather
xmlrpc
xmlsecurity
xquery
xslt
Expand Down Expand Up @@ -223,7 +224,6 @@ spring-ws #1476
stomp #2033
string-template #2034
telegram #2035
xmlrpc #2036
xmpp #2037
yammer #2038

Expand Down
6 changes: 3 additions & 3 deletions catalog/src/main/resources/dataformat.roadmap
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ syslog
tarfile
tidyMarkup
xmlBeans
xmlrpc
xstream
yaml-snakeyaml
zip
zipfile

[planned]

[undecided]
boon #2039
hessian #2040
ical #2041
Expand All @@ -47,7 +46,8 @@ univocity-csv #2045
univocity-fixed #2046
univocity-tsv #2047
xmljson #2048
xmlrpc #2049

[undecided]

[rejected]

5 changes: 5 additions & 0 deletions docs/guide/components/camel-xmlrpc.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### camel-xmlrpc

The http://camel.apache.org/xmlrpc.html[xmlrpc,window=_blank]
component provides a dataformat for xml, which allows serialization and deserialization of request messages and response message using the https://ws.apache.org/xmlrpc[Apache XmlRpc,window=_blank] binary dataformat. You can also invoke the XMLRPC Service through the camel-xmlrpc producer.
2 changes: 2 additions & 0 deletions docs/guide/components/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ include::camel-vertx.adoc[]

include::camel-weather.adoc[]

include::camel-xmlrpc.adoc[]

include::camel-xstream.adoc[]

include::camel-zendesk.adoc[]
Expand Down
1 change: 1 addition & 0 deletions docs/guide/dataformats/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The following lists supported Data Formats
* https://github.com/apache/camel/blob/master/components/camel-tarfile/src/main/docs/tarfile-dataformat.adoc[Tarfile,window=_blank]
* http://camel.apache.org/tidymarkup.html[TidyMarkup,window=_blank]
* http://camel.apache.org/xmlbeans.html[XmlBeans,window=_blank]
* http://camel.apache.org/xmlrpc.html[XmlRpc,window=_blank]
* http://camel.apache.org/xml-security-component.html[XMLSecurity,window=_blank]
* http://camel.apache.org/xstream.html[XStream,window=_blank]
* http://camel.apache.org/yaml-data-format.html[YAML,window=_blank]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
<module name="org.apache.camel.component.vertx" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.weather" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.xmlbeans" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.xmlrpc" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.xmlsecurity" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.xstream" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.zendesk" export="true" services="export" optional="true" />
Expand Down
15 changes: 15 additions & 0 deletions feature/pack/etc/smartics/camel-modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2119,6 +2119,21 @@
</dependencies>
</module>

<module name="org.apache.camel.component.xmlrpc">
<include artifact="org.apache.camel:camel-xmlrpc" />
<include artifact="org.apache.xmlrpc:" />
<apply-to-dependencies skip="true">
<include module="org.apache.camel.apt" />
<include module="org.springframework.boot" />
<include module="jaxmeapi" />
</apply-to-dependencies>
<dependencies>
<module name="javax.api"/>
<module name="org.apache.ws.commons.util"/>
<module name="org.slf4j"/>
</dependencies>
</module>

<module name="org.apache.camel.component.xmlsecurity">
<include artifact="org.apache.camel:camel-xmlsecurity" />
<apply-to-dependencies skip="true">
Expand Down
13 changes: 13 additions & 0 deletions feature/pack/etc/smartics/other-modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,19 @@
</dependencies>
</module>

<module name="org.apache.ws.commons.util" >
<properties>
<property name="jboss.api" value="private"/>
</properties>
<include artifact="org.apache.ws.commons.util:ws-commons-util"/>
<apply-to-dependencies skip="true">
<include module="junit" />
</apply-to-dependencies>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>

<module name="org.apache.xbean.$1">
<properties>
<property name="jboss.api" value="private"/>
Expand Down
7 changes: 4 additions & 3 deletions feature/pack/etc/smartics/skipped-modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@
<include artifact="io.sundr:sundr-codegen" />
</module>

<module name="jaxmeapi" skip="true">
<include artifact=":jaxmeapi" />
</module>

<module name="jexcelapi" skip="true">
<include artifact="jexcelapi:jxl" />
</module>
Expand Down Expand Up @@ -209,9 +213,6 @@
</module>

<module name="org.apache.commons.daemon" skip="true">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<include artifact=":commons-daemon"/>
</module>

Expand Down
4 changes: 4 additions & 0 deletions feature/pack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,10 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-xmlbeans</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-xmlrpc</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-xmlsecurity</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
<module name="org.apache.camel.component.vertx" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.weather" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.xmlbeans" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.xmlrpc" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.xmlsecurity" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.xstream" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.zendesk" export="true" services="export" optional="true" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.camel.component.xmlrpc">
<resources>
<artifact name="${org.apache.camel:camel-xmlrpc}" />
<artifact name="${org.apache.xmlrpc:xmlrpc-client}" />
<artifact name="${org.apache.xmlrpc:xmlrpc-common}" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="org.apache.ws.commons.util" />
<module name="org.slf4j" />
<module name="javax.xml.bind.api" />
<module name="org.apache.camel.core" />
<module name="org.apache.commons.httpclient" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.ws.commons.util">
<properties>
<property name="jboss.api" value="private" />
</properties>
<resources>
<artifact name="${org.apache.ws.commons.util:ws-commons-util}" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="org.apache.xerces" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* #%L
* Wildfly Camel :: Testsuite
* %%
* Copyright (C) 2013 - 2014 RedHat
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/

package org.wildfly.camel.test.xmlrpc;

import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.component.xmlrpc.XmlRpcRequestImpl;
import org.apache.camel.dataformat.xmlrpc.XmlRpcDataFormat;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.xmlrpc.XmlRpcRequest;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.extension.camel.CamelAware;

@CamelAware
@RunWith(Arquillian.class)
public class XmlRpcIntegrationTest {

@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class, "camel-xmlrpc-tests");
}

@Test
public void testRequestMessage() throws Exception {

CamelContext camelctx = new DefaultCamelContext();
camelctx.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {

XmlRpcDataFormat request = new XmlRpcDataFormat();
request.setRequest(true);

from("direct:request")
.marshal(request)
.to("log:marshalRequestMessage")
.unmarshal(request)
.to("log:unmarshalRequestMessage")
.to("mock:request");
}
});

camelctx.start();
try {
ProducerTemplate template = camelctx.createProducerTemplate();
MockEndpoint mock = camelctx.getEndpoint("mock:request", MockEndpoint.class);
mock.expectedMessageCount(1);
XmlRpcRequest result = template.requestBody("direct:request", new XmlRpcRequestImpl("greet", new Object[]{"you", 2}), XmlRpcRequest.class);
Assert.assertNotNull(result);
Assert.assertEquals("Get a wrong request operation name", "greet", result.getMethodName());
Assert.assertEquals("Get a wrong request parameter size", 2, result.getParameterCount());
Assert.assertEquals("Get a wrong request parameter", 2, result.getParameter(1));
mock.assertIsSatisfied();
} finally {
camelctx.stop();
}
}

@Test
public void testResponseMessage() throws Exception {

CamelContext camelctx = new DefaultCamelContext();
camelctx.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {

XmlRpcDataFormat response = new XmlRpcDataFormat();
response.setRequest(false);

from("direct:response")
.marshal(response)
.to("log:marshalResponseMessage")
.unmarshal(response)
.to("log:unmarshalResonseMessage")
.to("mock:response");

}
});

camelctx.start();
try {
ProducerTemplate template = camelctx.createProducerTemplate();
MockEndpoint mock = camelctx.getEndpoint("mock:response", MockEndpoint.class);
mock.expectedBodiesReceived("GreetMe from XmlRPC");
template.sendBody("direct:response", "GreetMe from XmlRPC");
mock.assertIsSatisfied();
} finally {
camelctx.stop();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
^org/apache/xmlbeans/impl/schema
^org/apache/xmlbeans/impl/values
^org/apache/zookeeper(.*)
^org/apache/xmlrpc(.*)
^org/asynchttpclient(.*)
^org/codehaus/groovy(.*)
^org/dozer(.*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,8 @@ org/apache/camel/component/vertx
org/apache/camel/component/weather
org/apache/camel/component/weather/geolocation
org/apache/camel/component/weather/http
org/apache/camel/component/xmlrpc
org/apache/camel/component/xmlrpc/converter
org/apache/camel/component/xmlsecurity
org/apache/camel/component/xmlsecurity/api
org/apache/camel/component/xmlsecurity/processor
Expand Down Expand Up @@ -1056,6 +1058,7 @@ org/apache/camel/dataformat/soap
org/apache/camel/dataformat/soap/name
org/apache/camel/dataformat/tagsoup
org/apache/camel/dataformat/tarfile
org/apache/camel/dataformat/xmlrpc
org/apache/camel/dataformat/xmlsecurity
org/apache/camel/dataformat/xstream
org/apache/camel/dataformat/zipfile
Expand Down Expand Up @@ -1451,6 +1454,14 @@ org/apache/olingo/odata2/core/uri/expression
org/apache/xmlbeans
org/apache/xmlbeans/impl/schema
org/apache/xmlbeans/impl/values
org/apache/xmlrpc
org/apache/xmlrpc/client
org/apache/xmlrpc/client/util
org/apache/xmlrpc/common
org/apache/xmlrpc/jaxb
org/apache/xmlrpc/parser
org/apache/xmlrpc/serializer
org/apache/xmlrpc/util
org/apache/zookeeper
org/apache/zookeeper/client
org/apache/zookeeper/common
Expand Down
4 changes: 4 additions & 0 deletions patch/etc/baseline/module-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@
/org/apache/camel/component/vertx/main/vertx-core-3.4.1.jar
/org/apache/camel/component/weather/main/camel-weather-2.19.3.jar
/org/apache/camel/component/xmlbeans/main/camel-xmlbeans-2.19.3.jar
/org/apache/camel/component/xmlrpc/main/camel-xmlrpc-2.19.3.jar
/org/apache/camel/component/xmlrpc/main/xmlrpc-client-3.1.3.jar
/org/apache/camel/component/xmlrpc/main/xmlrpc-common-3.1.3.jar
/org/apache/camel/component/xmlsecurity/main/camel-xmlsecurity-2.19.3.jar
/org/apache/camel/component/xstream/main/camel-xstream-2.19.3.jar
/org/apache/camel/component/zendesk/main/async-http-client-1.9.31.jar
Expand Down Expand Up @@ -342,6 +345,7 @@
/org/apache/sshd/main/sshd-core-0.14.0.jar
/org/apache/ws/commons/axiom/axiom-api/main/axiom-api-1.2.14.jar
/org/apache/ws/commons/axiom/axiom-impl/main/axiom-impl-1.2.14.jar
/org/apache/ws/commons/util/main/ws-commons-util-1.0.2.jar
/org/apache/xbean/spring/main/xbean-spring-4.5.jar
/org/apache/xmlbeans/main/xmlbeans-2.6.0.jar
/org/apache/zookeeper/main/curator-client-2.7.1.jar
Expand Down

0 comments on commit 163c8c4

Please sign in to comment.