Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Okay we are now setup for the contract first development and can generate the source file. For now we are still only using standard AXIS and not Spring nor Camel. We still need to setup AXIS as a web application so we configure the web.xml in src/main/webapp/WEB-INF/web.xml as:

Code Block
xml
xml
	    <servlet>
		        <servlet-name>axis</servlet-name>
		        <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
	    </servlet>

	    <servlet-mapping>
		        <servlet-name>axis</servlet-name>
		        <url-pattern>/services/*</url-pattern>
	    </servlet-mapping>

The web.xml just registeres AXIS servlet that is handling the incoming web requests to its servlet mapping. We still need to configure AXIS itself and this is done using its special configuration file server-config.wsdd. We nearly get this file for free if we let Axis generate the source code so we run the maven goal:

...

What we need to do now is important, as we need to modify the above configuration to use our webservice class than the default one, so we change the classname parameter to our class AxisReportIncidentService:

Code Block
xml
xml
<parameter name="className" value="org.apache.camel.example.axis.AxisReportIncidentService"/>

...

Code Block
mvn jetty:run

Then we can hit the webbrowser web browser and enter this URL: http://localhost:8080/camel-example-axis/services and you should see the famous AXIS page with the text And now... Some Services.

Clicking on the .wsdl link shows the wsdl file, but what. It's an autogenerated auto generated one and not our original .wsdl file. So we need to fix this ASAP and this is done by configuring AXIS in the server-config.wsdd file:

...

TODO: How to embed Jetty and run a unit test by hitting a webservice call and expect the file output
TODO: Spring use onInit() to get the service once
TODO: Use spring dependency injection instead of property
TODO: Use Camel annotations
TODO: Maybe a route?
TODO: Use Camel Test Kit
TODO: Refer to Axis documentation. AXIS -> Axis.
TODO: Add more links to Camel stuff
TODO: Link to other tutorials