

CREATE COMPUTE MODULE VALIDATION_COMPUTE_PARAM_MAPPING
	CREATE FUNCTION Main() RETURNS BOOLEAN
	BEGIN
		CALL CopyMessageHeaders();
		CALL CopyEntireMessage();
		
		SET OutputLocalEnvironment = InputLocalEnvironment;

		--SET OutputRoot.XMLNSC.data.original = InputRoot.SOAP.Body;
		
		--DELETE FIELD OutputRoot.XMLNSC.data.original.xsi;
		--DELETE FIELD OutputRoot.XMLNSC.data.original.xsd;

		SET OutputRoot.XMLNSC.data.body.appName = InputRoot.SOAP.Body.*[1].security.appName;
		SET OutputRoot.XMLNSC.data.body.hashcode = InputRoot.SOAP.Body.*[1].security.hashcode;
		SET OutputRoot.XMLNSC.data.body.transactioncode = InputRoot.SOAP.Body.*[1].security.transactioncode;
	
		SET OutputRoot.XMLNSC.data.body.ipaddress = InputRoot.HTTPInputHeader."X-Remote-Addr";
		SET OutputRoot.XMLNSC.data.body.operation = InputRoot.SOAP.Context.operation;
					
		SET OutputRoot.XMLNSC.data.body.param_req = InputRoot.SOAP.Body.*[1].security.appName || '-' || InputRoot.SOAP.Context.operation || '-' || InputRoot.HTTPInputHeader."X-Remote-Host";
		--SET OutputRoot.XMLNSC.data.body.userid = InputRoot.SOAP.Body.*[1].security.userid;
	
		RETURN TRUE;
	END;

	

	CREATE PROCEDURE CopyMessageHeaders() BEGIN
		DECLARE I INTEGER 1;
		DECLARE J INTEGER;
		SET J = CARDINALITY(InputRoot.*[]);
		WHILE I < J DO
			SET OutputRoot.*[I] = InputRoot.*[I];
			SET I = I + 1;
		END WHILE;
	END;

	CREATE PROCEDURE CopyEntireMessage() BEGIN
		SET OutputRoot = InputRoot;
	END;
END MODULE;


CREATE COMPUTE MODULE VALIDATION_COMPUTE_AUTHORIZATION
	CREATE FUNCTION Main() RETURNS BOOLEAN
	BEGIN
		CALL CopyMessageHeaders();
		CALL CopyEntireMessage();
		
--		IF (OutputRoot.XMLNSC.data.body.param_req).contains
		
		RETURN TRUE;
	END;

	CREATE PROCEDURE CopyMessageHeaders() BEGIN
		DECLARE I INTEGER 1;
		DECLARE J INTEGER;
		SET J = CARDINALITY(InputRoot.*[]);
		WHILE I < J DO
			SET OutputRoot.*[I] = InputRoot.*[I];
			SET I = I + 1;
		END WHILE;
	END;

	CREATE PROCEDURE CopyEntireMessage() BEGIN
		SET OutputRoot = InputRoot;
	END;
END MODULE;


CREATE COMPUTE MODULE VALIDATION_Compute
	CREATE FUNCTION Main() RETURNS BOOLEAN
	BEGIN
		-- CALL CopyMessageHeaders();
		-- CALL CopyEntireMessage();
		RETURN TRUE;
	END;

	CREATE PROCEDURE CopyMessageHeaders() BEGIN
		DECLARE I INTEGER 1;
		DECLARE J INTEGER;
		SET J = CARDINALITY(InputRoot.*[]);
		WHILE I < J DO
			SET OutputRoot.*[I] = InputRoot.*[I];
			SET I = I + 1;
		END WHILE;
	END;

	CREATE PROCEDURE CopyEntireMessage() BEGIN
		SET OutputRoot = InputRoot;
	END;
END MODULE;
