Post SOAP request from command line

Sometimes you may need to post a SOAP request from command line.
This article shows how to do this using the curl command on UNIX systems.
Get HTTP header from service implementator class with CXF.
SOAP runtimes like CXF allows to interact with the inbound/outbound messages with interceptors.
Interceptors are the fundamental processing unit inside CXF. When a service is invoked, an InterceptorChain is created and invoked. Each interceptor gets a chance to do what they want with the message. This can include reading it, transforming it, processing headers, validating the message, etc.
Interceptors are used with both CXF clients and CXF servers. When a CXF client invokes a CXF server, there is an outgoing interceptor chain for the client and an incoming chain for the server. When the server sends the response back to the client, there is an outgoing chain for the server and an incoming one for the client.
Axis, Axis2 and CXF
They are of course in many ways comparable; of necessity web services frameworks must fill in all the same blanks, but since both projects are very young, each has certain areas that are more well-developed than others. The chief differences are as follows:
CXF has support for WS-Addressing, WS-Policy, WS-RM, WS-Security, and WS-I BasicProfile. Axis2 supports each of these except for WS-Policy, which will be supported in an upcoming version
CXF was written with Spring in mind; Axis2 is not
Axis2 supports a wider range of data bindings, including XMLBeans, JiBX, JaxMe and JaxBRI as well as its own native data binding, ADB. Note that support for JaxME and JaxBRI are still considered experimental in Axis2 1.2. CXF currently supports only JAXB and Aegis; support for XMLBeans, JiBX and Castor will come in CXF 2.1
Axis2 supports multiple languages–there is a C/C++ version available in addition to the Java version.
SOAP Web services terminology
In this article we will see some useful terminology used in SOAP Web Services like Databinding or Web service runtime. Let’s start with databindings.
The most common types of databindings are ADB and XMLBeans.
ADB is a data-binding extension for Axis2. Unlike the other data-binding frameworks, ADB code is usable only for Axis2 web services. This restriction is a significant limitation of ADB, but also confers some advantages. Because ADB is integrated with Axis2, the code can be optimized for Axis2 requirements.
ADB also offers some enhanced features not currently available with the other data-binding frameworks, including automatic attachment handling. WSDL2Java provides full support for ADB code generation, including generating data model classes corresponding to the XML schema components.

If you want to learn more retro games news, read our magazine and subscribe to our newsletter.