I'm new to teiid in general as well as the Teiid Designer (7.4.2), and have gotten web service generation to work, but I don't understand how it is working.
Specifically, I am generation a web service from an existing virtual procedure, lets call it ProcX. ProcX takes a couple of string arguments, i_y and i_z, and returns a ProcXResult.
In the Designer, I right-click on ProcX, Modeling > Create Web Service, and go through the wizard. It generates a ProcX_WS.xmi, a ProcX_OutputView.xmi and the input and output xsds used by them.
OK so far (except that the code it generates for the output view attempts to select from the result, and not the proc, but I figured out how to fix that).
Here's the code I can see in the code for the ProcX_WS.xmi (names change by hand from my actual web service model, so please bear with me if I missed something):
CREATE VIRTUAL PROCEDURE
DECLARE string VARIABLES.IN_I_Y;
DECLARE string VARIABLES.IN_I_Z;
VARIABLES.IN_I_Y = xPathValue(ProcX_WS.Procedures_ProcXResult.getProcXResult.ProcX_InputMsg, '/*:ProcX_Input/*:i_y');
VARIABLES.IN_I_Z = xPathValue(ProcX_WS.Procedures_ProcXResult.getProcXResult.ProcX_InputMsg, '/*:ProcX_Input/*:i_z');
SELECT * FROM ProcX_Output_View.ProcXResult_OutputView
WHERE (ProcX_Output_View.ProcXResult_OutputView.ProcXResult_Output.ProcXResult_Output_Instance.i_y = VARIABLES.IN_I_Y) AND (ProcX_Output_View.ProcXResult_OutputView.ProcXResult_Output.ProcXResult_Output_Instance.i_z = VARIABLES.IN_I_Z);
And here, the transform for the ProcX_Output_View (after I remove the ".ProcXResult" which was causing an error ):
SELECT * FROM Procedures.ProcX
And this all seems to work. I was able to generate the JBossWS-CXF war file, deploy it to a local JBoss and test it with SoapUI with several different sets of arguments, and it worked fine.
However, I am at a loss to understand how the parameters are getting to the proc. I see that the params are pulled from the input xml with the xPathValue. I see that the WHERE clause is filtering on those parameters, and that they are mapped in the output view, even though we don't need them in the output.
I don't understand why we are selecting from
ProcX_Output_View.ProcXResult_OutputView, but filtering on
(nor what ProcXResult_Output_Instance is, for that matter)
Nor do I understand how the procedure, ProcX is getting the parameters it requires. I saw in the documentation for teiid where you can effectively do an exec on a procedure with a select by providing the parameters in the where (e.g.: select * from Procedures.ProcX where i_y = 'foo' and i_z = 'bar'), but we aren't doing that here.
Can someone enlighten me on how this all fits together?