|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 3 of 6
The steps to implement our SOA integration layer are as follows:
WireTap to log messages
CamelContext XML
To start, we use the Maven cxf-codegen-plugin and the wsdl2java tool provided by CXF to generate the Java artifacts from the three WSDLs found in the article source code. To execute the POM, use: cmd : mvn generate-sources. CXF generates the Java artifacts and puts them in the specified directory. We then use Maven to build our artifacts.
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.0</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/src/main/java</sourceRoot>
<wsdlOptions>
<wsdlOption>
//ReservationService invoked by Portal
<wsdl>${basedir}/src/main/resources/wsdl/ReservationService.wsdl</wsdl>
</wsdlOption>
<wsdlOption>
//ReservationService exposed by Airline A
<wsdl>${basedir}/src/main/resources/wsdl/ReservationServiceAirlineA.wsdl</wsdl>
</wsdlOption>
<wsdlOption>
//ReservationService exposed by Airline B
<wsdl>${basedir}/src/main/resources/wsdl/ReservationServiceAirlineB.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
Next, we define the endpoints for ReservationService, ReservationServiceAirlineA, and ReservationServiceAirlineB shown in Listing 2 below. These endpoints will be used subsequently in our Camel routes. Note that the Service interface class generated in Step 1 is referenced by the camel-cxf endpoint.
The camel-cxf endpoint uses the default dataFormat=POJO. In this example we used the data format of PAYLOAD to get the raw XML into our Camel endpoint and process the XML in our Camel routes. Enabling schema validation validates
the incoming request against the XSD schema defined in the WSDL, which reduces the time we would otherwise need to invest
in validation.
//Endpoint of Mock ReservationService for Airline A
<cxf:cxfEndpoint id="airlineAEndpoint"
address="http://localhost:8089/QuoteService" serviceClass="com.sample.aira.quote.AirLineAQuote"
wsdlURL="wsdl/ReservationServiceAirlineA.wsdl">
<cxf:properties>
<entry key="dataFormat" value="PAYLOAD" />
</cxf:properties>
</cxf:cxfEndpoint>
//Endpoint of Mock ReservationService for Airline B
<cxf:cxfEndpoint id="airlineBEndpoint"
address="http://localhost:8088/QuoteService" serviceClass="com.sample.airb.quote.AirLineBQuote"
wsdlURL="wsdl/ReservationServiceAirlineB.wsdl">
<cxf:properties>
<entry key="dataFormat" value="PAYLOAD" />
</cxf:properties>
</cxf:cxfEndpoint>
//Endpoint of ReservationService
<cxf:cxfEndpoint id="reservationService" address="/QuoteService"
serviceClass="com.sample.air.quote.AirLineQuote" wsdlURL="wsdl/ReservationService.wsdl">
<cxf:properties>
<entry key="dataFormat" value="PAYLOAD" />
<entry key="schema-validation-enabled" value="true" />
</cxf:properties>
</cxf:cxfEndpoint>