I am trying to create an Apache Axis (1.4) web service client. The webservice client is a bit unusual in the sense that all it does is submit an XML payload of various data to the server, and all it gets back is an 'OK' message.
We have a WSDL and used WSDL2Java to create the shell of the client code.
So, the relevant code in the generated files looks like this:
static {
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("request");
elemField.setXmlName(new javax.xml.namespace.QName("http://xmlns.acme.com", "Request"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField = new org.apache.axis.description.ElementDesc();
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
This "Request" field is our XML payload, and we need it to be wrapped in CDATA[]. However, after hours of searching, I have no idea how to denote to Axis to serialize this element as CDATA, rather than escaped text.
So my questions are:
1) How can I do this? Is it even possible in Axis with WSDL2Java? Is there an easier way to do this if I don't use WSDL2Java?
2) We are not married to Axis - is there an alternative library I should try? (It is a very simple webservice to be invoked by Cron job... I'm looking for the simplest possible way to invoke this service)
Thank you.