We are investigating to enhance our running axis2 service with JSON support,
i.e. to use JSON over SOAP to facilitate support non-java clients.
I'm doing feasibility checks for mapped JSON using the StockQuoteService from
samples.quickstartadb in axis-1.8.2 (as described in JSON support in Axis2
tutorial)
With the JSONOMBuilder this works as expected:axis2.xml:<messageBuilder
contentType="application/json" class="org.apache.axis2.json.JSONOMBuilder"/>
JSON message for operation 'getPrice': {"getPrice":{"symbol":"IBM"}}SOAP body
in StockQuoteServiceMessageReceiverInOut.invokeBusinessLogic:
<soapenv:Body
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><getPrice
xmlns="http://quickstart.samples/xsd"><symbol>IBM</symbol></getPrice></soapenv:Body>
However when I switch to the moshi.JSONBuilder, the SOAP Body will be
empty:axis2.xml: <messageBuilder contentType="application/json"
class="org.apache.axis2.json.moshi.JsonBuilder" />
SOAP body in StockQuoteServiceMessageReceiverInOut.invokeBusinessLogic:
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>
Getting the wrapped param with fromOM will then fail in
fromOM(
msgContext.getEnvelope().getBody().getFirstElement(),
samples.quickstart.service.adb.xsd.GetPrice.class);
with AxisFault "Cannot invoke
"org.apache.axiom.om.OMElement.getXMLStreamReaderWithoutCaching()" because
"param" is null"
What am I missing? Can the moshi.JSONBuilder not be used for mapped JSON with
ADB?