But you may get an apache error of "service unavaliable". Te solution is executing de followning command:
/usr/sbin/setsebool -P httpd_can_network_connect true
# The Web proxy server used by this account http_proxy="http://usuario:password@my.proxy:8080" export no_proxy=localhost,127.0.0.1 export http_proxy
# The Web proxy server used by this account source .bash_profile
<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>
<groupId>es.cixtec.arq.pruebas</groupId>
<artifactId>camel-dynamic-route</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<camel.version>2.12.0</camel.version>
<version.jboss.as> 7.3.0.Final-redhat-14</version.jboss.as>
<spring.version>3.2.4.RELEASE</spring.version>
<slf4j.version>1.6.6</slf4j.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.camel</groupId>
<artifactId>camel-maven-plugin</artifactId>
<version>${camel.version}</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-jms-client-bom</artifactId>
<version>${version.jboss.as}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
</dependencies>
</project>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<!-- ********************************************* -->
<!-- ********** JMS CONFIG *********************** -->
<!-- ********************************************* -->
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">org.jboss.naming.remote.client.InitialContextFactory</prop>
<prop key="java.naming.provider.url">remote://localhost:4447</prop>
<prop key="java.naming.security.principal">quickstartUser</prop>
<prop key="java.naming.security.credentials">quickstartPwd1!</prop>
</props>
</property>
</bean>
<bean id="jmsQueueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate" ref="jndiTemplate"/>
<property name="jndiName" value="jms/RemoteConnectionFactory"/>
</bean>
<bean name="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="jmsQueueConnectionFactory" />
</bean>
<!-- ********************************************* -->
<!-- ****************************** -->
<!-- ****** RUTA ****************** -->
<!-- ****************************** -->
<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
<route id="mainGestionRoute">
<from uri="jms:queue:testQueue?username=quickstartUser&password=quickstartPwd1!" />
<log message="JMSCorrelationID: ${header.JMSCorrelationID}"/>
<log message="JMSDeliveryMode: ${header.JMSDeliveryMode}"/>
<log message="JMSDestination: ${header.JMSDestination}"/>
<log message="JMSExpiration: ${header.JMSExpiration}"/>
<log message="JMSMessageID: ${header.JMSMessageID}"/>
<log message="JMSPriority: ${header.JMSPriority}"/>
<log message="JMSRedelivered: ${header.JMSRedelivered}"/>
<log message="JMSReplyTo: ${header.JMSReplyTo}"/>
<log message="JMSMessageID: ${header.JMSMessageID}"/>
<log message="JMSTimestamp: ${header.JMSTimestamp}"/>
<log message="JMSType: ${header.JMSType}"/>
<log message="JMSXGroupID: ${header.JMSXGroupID}"/>
<to uri="log:receivedMessage?level=INFO" />
</route>
</camelContext>
</beans>
<bean id="wsss4JOutInterceptor" class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
<constructor-arg>
<map>
<entry key="action" value="Signature"/>
<entry key="user" value="xxxxx"/> <!-- This is a bug in CXF 2.7.6. It was solved in laters versions -->
<entry key="signaturePropRefId" value="signaturePropertiesBean" />
<entry key="signaturePropertiesBean" value-ref="signatureProperties" />
<entry key="signatureUser" value="myclientkey" />
<entry key="passwordCallbackRef" value-ref="clientCallback" />
<entry key="signatureKeyIdentifier" value="DirectReference" />
<entry key="signatureParts" value="{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body" />
<entry key="addInclusivePrefixes" value="false" />
<entry key="includeSignatureToken" value="true" />
<entry key="mustUnderstand" value="false" />
</map>
</constructor-arg>
</bean>
<util:properties id="signatureProperties">
<prop key="org.apache.ws.security.crypto.provider">org.apache.ws.security.components.crypto.Merlin</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.file">D:/temp/certificates/client-IdentityStore(1234).jks</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.type">jks</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.provider">SUN</prop>
<prop key="org.apache.ws.security.crypto.merlin.keystore.password">1234</prop>
<prop key="org.apache.ws.security.crypto.merlin.load.cacerts">false</prop>
</util:properties>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<version>2.3.0</version>
<configuration>
<extensions>
<extension>org.apache.cxf.xjcplugins:cxf-xjc-dv:2.3.0</extension>
</extensions>
</configuration>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>xsdtojava</goal>
</goals>
<configuration>
<sourceRoot>${basedir}/src/main/java</sourceRoot>
<xsdOptions>
<xsdOption>
<xsd>${basedir}/src/main/resources/META-INF/xsd/myTest-1.xsd</xsd>
<packagename>es.pruebas.model1</packagename>
</xsdOption>
<xsdOption>
<xsd>${basedir}/src/main/resources/META-INF/xsd/myTest-2.xsd</xsd>
<packagename>es.pruebas.model2</packagename>
</xsdOption>
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>
ObjectFactory objectFactory = new ObjectFactory(); JAXBElement<myrootclass> respuestaJAXBElement = objectFactory.createPublicacion(myRootObject); final Marshaller marshaller = JAXBContext.newInstance(ObjectFactory.class).createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); final StringWriter writer = new StringWriter(); marshaller.marshal(respuestaJAXBElement, writer); return writer.toString();
final Unmarshaller unmarshaller = JAXBContext.newInstance(ObjectFactory.class).createUnmarshaller(); JAXBElement<myrootclass> jaxbElement = (JAXBElement<myrootclass>) unmarshaller.unmarshal(inputStream); return jaxbElement.getValue();
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>
<executions>
<execution>
<id>Generate-clases-xsd</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaDirectory>src/main/resources/META-INF/xsd/</schemaDirectory>
<schemaIncludes>
<include>myTest-1.xsd</include>
<include>myTest-2.xsd</include>
</schemaIncludes>
<bindingDirectory>src/main/resources/META-INF/xsd</bindingDirectory>
<bindingIncludes>
<include>all-schemas-bindings.xjb</include>
</bindingIncludes>
</configuration>
</execution>
</executions>
<configuration>
<args>
<arg>-Xannotate</arg>
<arg>-nv</arg>
</args>
<extension>true</extension>
<debug>false</debug>
<verbose>false</verbose>
<episode>false</episode>
<forceRegenerate>false</forceRegenerate>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.9.4</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>1.0.1</version>
</plugin>
</plugins>
</configuration>
</plugin>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings
version="2.1"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:annox="http://annox.dev.java.net" >
<jaxb:globalBindings generateIsSetMethod="true"/>
<jaxb:bindings schemaLocation="myTest-1.xsd" node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="es.pruebas.model1"/>
</jaxb:schemaBindings>
<jaxb:bindings node="//xs:complexType[@name='MyRootElement1']">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="MyRootElement1"/>
</annox:annotate>
</jaxb:bindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="myTest-2.xsd" node="/xs:schema">
<jaxb:schemaBindings>
<jaxb:package name="es.pruebas.model2"/>
</jaxb:schemaBindings>
<jaxb:bindings node="//xs:element[@name='MyRootElement2']">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="MyRootElement2"/>
</annox:annotate>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>