we are on 7.1 EE and I've been tasked with designing a SOAP/WSDL web service running on Mule that could be consumed by the external clients. The WSDL is given as an input.
The MuleSoft's recommended way is to use CXF component for the purpose, generate java classes with wsdl2java and then add the WS logic to the java code. This of course works but it's more a java way of doing the task rather than Mule ESB way.
I would prefer an approach where Mule flow and message transforming components implement the WS logic rather than the java classes.
Actually, the APIKit is already working this way. Unfortunately, it doesn't support WSDL. So, what I'm looking for is the following:
- Getting the WS input as a POJO in the payload (after the schema been validated by CXF).
- Use DataMapper to transform the POJO to let's say some external VM input parameters
- Get the response from VM into DataMapper, put the values into the WS Response POJO.
- Letting the CXF to complete the task of returning the response to the caller.
This would be more Mule way of doing the task, IMHO.
Now, looking at the java code generated there are request and response POJOs already there and could be used in DataMapper.
I suspect that there could be actually a way of getting the WS request POJO in the Mule payload, transform it, populate the result POJO and somehow return it back to CXF.
Any ideas of how this could be implemented?
Pls note that I don't think that using CXF proxy mode is a good alternative. Because with this approach you effectively loosing a knowledge about the request/response format. And then you'll have to manually define the payload fields for the mapping... Effectively, this would be a manual SOAP parsing.