| org.xins.server.CallingConvention org.xins.server.SOAPCallingConvention org.xins.server.SOAPMapCallingConvention
SOAPMapCallingConvention | public class SOAPMapCallingConvention extends SOAPCallingConvention (Code) | | The SOAP calling convention that tries to map the SOAP request to the
parameters of the function. The rules applied for the mapping are the same
as for the command wsdl-to-api.
Note that by default any SOAP message will be handled by the _xins_soap
calling convention. If you want to use this calling convention you will
need to explicitly have _convention=_xins_soap_map in the URL parameters.
This calling convention is easily extendable in order to adapt to the
specificity of your SOAP requests.
Here is the mapping for the input:
- If the element in the Body ends with 'Request', the function name is
considered to be what is specified before
- Otherwise the name of the element is used for the name of the function
- Elements in the request are mapped to input parameters if available.
- Elements with sub-elements are mapped to input parameters element1.sub-element1... if available.
- If no parameter is found, try to find an input data element with the name.
- If not found, go to the sub-elements and try to find an input data element with the name.
- If not found, skip it. Here it's up to you to override this convention and provide a mapping.
Here is the mapping for the output:
- Response name = function name + "Response"
- Output parameters with dots are transformed to XML.
e.g. element1.element2 -> <element1><element2>value</element2></element1>
- The data section is not put in the returned XML, only the elements it contains.
- Data section element attributes are changed to sub-elements with the
same rule as for output parameters.
version: $Revision: 1.8 $ $Date: 2007/09/18 08:45:06 $ author: Anthony Goubard since: XINS 2.1. |
Field Summary | |
final protected static String | REQUEST_BODY The key used to store the Body element of the request. | final protected static String | REQUEST_ENVELOPE The key used to store the Envelope element of the request. | final protected static String | REQUEST_FUNCTION The key used to store the function element of the request. |
Method Summary | |
protected FunctionRequest | convertRequestImpl(HttpServletRequest httpRequest) | protected void | convertResultImpl(FunctionResult xinsResult, HttpServletResponse httpResponse, HttpServletRequest httpRequest) | protected boolean | matches(HttpServletRequest httpRequest) | protected FunctionRequest | readInput(Element functionElem, String functionName) Generates the function request based the the SOAP request. | protected Element | readInputElem(Element inputElem, String functionName, String parent, Element parentElement, BasicPropertyReader inputParams) Parses the SOAP request element according to the rules specified in this
class description. | protected void | setDataElementAttribute(ElementBuilder builder, String attributeName, String attributeValue, String elementNameSpacePrefix) | protected void | writeOutputDataElement(Map dataSectionSpec, Element dataElement, Element parent) Write the given output data element in the SOAP response. | protected void | writeOutputDataSection(String functionName, FunctionResult xinsResult, Element response) Writes the output data section to the SOAP XML. | protected void | writeOutputParameter(String parameterName, String parameterValue, Element parent) Write an output parameter to the SOAP response. | protected void | writeOutputParameters(String functionName, FunctionResult xinsResult, Element response) Writes the output parameters to the SOAP XML. | protected Element | writeResponse(HttpServletRequest httpRequest, FunctionResult xinsResult) |
REQUEST_BODY | final protected static String REQUEST_BODY(Code) | | The key used to store the Body element of the request.
|
REQUEST_ENVELOPE | final protected static String REQUEST_ENVELOPE(Code) | | The key used to store the Envelope element of the request.
|
REQUEST_FUNCTION | final protected static String REQUEST_FUNCTION(Code) | | The key used to store the function element of the request.
|
readInput | protected FunctionRequest readInput(Element functionElem, String functionName)(Code) | | Generates the function request based the the SOAP request.
This function will get the XML element in the SOAP request and associate
the values with the input parameter or data section element of the function.
Parameters: functionElem - the SOAP element of the function request, cannot be null . Parameters: functionName - the name of the function, cannot be null .the function request that will be passed to the XINS function, cannot be null . |
readInputElem | protected Element readInputElem(Element inputElem, String functionName, String parent, Element parentElement, BasicPropertyReader inputParams) throws Exception(Code) | | Parses the SOAP request element according to the rules specified in this
class description.
Parameters: inputElem - the SOAP request element, cannot be null . Parameters: functionName - the name of the function, cannot be null . Parameters: parent - the name of the super element, can be null . Parameters: parentElement - the input data element that is being created, can be null . Parameters: inputParams - the PropertyReader where the input parameters should be stored, cannot be null .the input data element for the FunctionRequest or null if the SOAPrequest does not need to create a input data element. throws: Exception - if anything goes wrong such specifications not available or incorrect SOAP request. |
writeOutputDataElement | protected void writeOutputDataElement(Map dataSectionSpec, Element dataElement, Element parent)(Code) | | Write the given output data element in the SOAP response.
Parameters: dataSectionSpec - the specification of the output data elements for the function, cannot be null . Parameters: dataElement - the data element to tranform as SOAP element, cannot be null . Parameters: parent - the parent element to add the created element, cannot be null . |
writeOutputDataSection | protected void writeOutputDataSection(String functionName, FunctionResult xinsResult, Element response)(Code) | | Writes the output data section to the SOAP XML.
Parameters: functionName - the name of the function called. Parameters: xinsResult - the result of the call to the function. Parameters: response - the SOAP response element, cannot be null . |
writeOutputParameter | protected void writeOutputParameter(String parameterName, String parameterValue, Element parent)(Code) | | Write an output parameter to the SOAP response.
Parameters: parameterName - the name of the output parameter, cannot be null . Parameters: parameterValue - the value of the output parameter, cannot be null . Parameters: parent - the parent element to put the created element in, cannot be null . |
writeOutputParameters | protected void writeOutputParameters(String functionName, FunctionResult xinsResult, Element response)(Code) | | Writes the output parameters to the SOAP XML.
Parameters: functionName - the name of the function called, cannot be null . Parameters: xinsResult - the result of the call to the function, cannot be null . Parameters: response - the SOAP response element, cannot be null . |
Methods inherited from org.xins.server.SOAPCallingConvention | protected FunctionRequest convertRequestImpl(HttpServletRequest httpRequest) throws InvalidRequestException, FunctionNotSpecifiedException(Code)(Java Doc) protected void convertResultImpl(FunctionResult xinsResult, HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws IOException(Code)(Java Doc) protected String[] getSupportedMethods()(Code)(Java Doc) protected boolean matches(HttpServletRequest httpRequest) throws Exception(Code)(Java Doc) protected Element readDataSection(Element parametersElem, String functionName) throws InvalidRequestException(Code)(Java Doc) protected BasicPropertyReader readInputParameters(Element parametersElem, String functionName)(Code)(Java Doc) protected void setDataElementAttribute(ElementBuilder builder, String attributeName, String attributeValue, String elementNameSpacePrefix)(Code)(Java Doc) protected Element soapElementTransformation(Map dataSection, boolean input, Element element, boolean top)(Code)(Java Doc) protected String soapInputValueTransformation(Type parameterType, String value) throws InvalidSpecificationException(Code)(Java Doc) protected String soapOutputValueTransformation(Type parameterType, String value) throws InvalidSpecificationException(Code)(Java Doc) protected void writeFaultSection(String functionName, String namespaceURI, FunctionResult xinsResult, XMLOutputter xmlout) throws IOException(Code)(Java Doc) protected void writeOutputDataSection(String functionName, FunctionResult xinsResult, XMLOutputter xmlout) throws IOException(Code)(Java Doc) protected void writeOutputParameters(String functionName, FunctionResult xinsResult, XMLOutputter xmlout) throws IOException(Code)(Java Doc)
|
Methods inherited from org.xins.server.CallingConvention | static void cleanUpParameters(BasicPropertyReader parameters) throws IllegalArgumentException(Code)(Java Doc) final FunctionRequest convertRequest(HttpServletRequest httpRequest) throws IllegalStateException, IllegalArgumentException, InvalidRequestException, FunctionNotSpecifiedException(Code)(Java Doc) abstract protected FunctionRequest convertRequestImpl(HttpServletRequest httpRequest) throws InvalidRequestException, FunctionNotSpecifiedException(Code)(Java Doc) final void convertResult(FunctionResult xinsResult, HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws IllegalStateException, IllegalArgumentException, IOException(Code)(Java Doc) abstract protected void convertResultImpl(FunctionResult xinsResult, HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws IOException(Code)(Java Doc) BasicPropertyReader gatherParams(HttpServletRequest httpRequest) throws InvalidRequestException(Code)(Java Doc) final protected API getAPI()(Code)(Java Doc) final String getConventionName()(Code)(Java Doc) protected String[] getSupportedMethods()(Code)(Java Doc) protected String[] getSupportedMethods(HttpServletRequest request)(Code)(Java Doc) abstract protected boolean matches(HttpServletRequest httpRequest) throws Exception(Code)(Java Doc) final boolean matchesRequest(HttpServletRequest httpRequest)(Code)(Java Doc) protected Element parseXMLRequest(HttpServletRequest httpRequest) throws IllegalArgumentException, InvalidRequestException(Code)(Java Doc) protected Element parseXMLRequest(HttpServletRequest httpRequest, boolean checkType) throws IllegalArgumentException, InvalidRequestException(Code)(Java Doc) final void setAPI(API api)(Code)(Java Doc) final void setConventionName(String conventionName)(Code)(Java Doc)
|
|
|