public class SoapRequestParser extends ServiceArgumentsParser
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,LegacyServiceParameter> |
params
The map of service input parameters, (FWD-style) as defined at the WSDL operation.
|
private LegacyServiceParameter[] |
serviceParameters
The list of service input parameters (FWD-style) as defined at the WSDL operation.
|
private java.util.Map<java.lang.String,WsdlConfig.BaseSchemaType> |
soapParams
The schema definition for the service input parameters, as defined at the schema.
|
private org.apache.axiom.om.OMElement |
soapRequest
The SOAP body element which encodes the request.
|
Constructor and Description |
---|
SoapRequestParser(LegacyServiceParameter[] params,
org.apache.axiom.om.OMElement soapRequest,
javax.wsdl.Operation soapOperation,
WsdlConfig wsdlConfig)
Initialize this instance, to parse the input parameters for the SOAP operation.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assignArgument(int idx,
BaseDataType bdt,
java.lang.String sval)
Assign the given argument to the specified value.
|
private java.lang.Object |
createArgument(java.lang.String xsdType,
java.lang.Class<?> type,
java.lang.String sval)
Create a new
BaseDataType instance and restore its value from the given string,
based on the XSD type. |
protected DatasetWrapper |
createDataset(java.lang.String name,
boolean input,
boolean output,
boolean asHandle)
Create a new
DatasetWrapper , so that the transfer is made via XML. |
protected TableWrapper |
createTable(java.lang.String name,
boolean input,
boolean output,
boolean asHandle)
Create a new
TableWrapper , so that the transfer is made via XML. |
private LegacyServiceParameter |
getLegacyParameter(java.lang.String source)
Get the service parameter with the given name.
|
private org.apache.axiom.om.OMElement |
getSoapParameter(java.lang.String source)
Get the SOAP element from the envelope's body, for the specified parameter.
|
private java.util.Iterator<org.apache.axiom.om.OMElement> |
getSoapParameters(java.lang.String source)
Get the SOAP elements from the envelope's body, for the specified parameter.
|
protected DatasetWrapper |
loadDataSet(java.lang.String content)
Load the specified dataset.
|
protected TableWrapper |
loadTable(java.lang.String content)
Load the specified table.
|
protected void |
notAValue(BaseDataType bdt,
java.lang.String val)
Raises an error so that the request stops with a 5xx internal server error.
|
protected java.lang.String |
parseArgumentInt(java.lang.String body,
java.lang.String source,
javax.servlet.http.HttpServletRequest request)
Parse the argument, by interpreting the request.
|
protected java.lang.Object[] |
parseExtentArgument(java.lang.String body,
javax.servlet.http.HttpServletRequest request,
int idx,
java.lang.String source,
java.lang.String type,
int extent)
Parse an extent argument.
|
parseArguments, parseArguments, parseArguments
private final org.apache.axiom.om.OMElement soapRequest
private final java.util.Map<java.lang.String,LegacyServiceParameter> params
private final java.util.Map<java.lang.String,WsdlConfig.BaseSchemaType> soapParams
private final LegacyServiceParameter[] serviceParameters
public SoapRequestParser(LegacyServiceParameter[] params, org.apache.axiom.om.OMElement soapRequest, javax.wsdl.Operation soapOperation, WsdlConfig wsdlConfig)
params
- The output parameters for the SOAP operation.soapRequest
- The SOAP request body.soapOperation
- The SOAP operation as defined in the WSDL.wsdlConfig
- The WSDL configuration.protected java.lang.Object[] parseExtentArgument(java.lang.String body, javax.servlet.http.HttpServletRequest request, int idx, java.lang.String source, java.lang.String type, int extent) throws RequestArgumentError
parseExtentArgument
in class ServiceArgumentsParser
body
- The HTTP body.request
- The request payload.idx
- The argument's index.source
- The arguments's source.type
- The arguments's type.extent
- The arguments's length.RequestArgumentError
protected void assignArgument(int idx, BaseDataType bdt, java.lang.String sval) throws RequestArgumentError
This will assign the bdt
instance, depending on the argument's configured XSD type.
assignArgument
in class ServiceArgumentsParser
idx
- The argument's index.bdt
- The argument's BaseDataType
instance (may be null
).sval
- The string representation of this argument.RequestArgumentError
protected java.lang.String parseArgumentInt(java.lang.String body, java.lang.String source, javax.servlet.http.HttpServletRequest request) throws java.io.IOException
parseArgumentInt
in class ServiceArgumentsParser
body
- The request body.source
- The parameter's encoded source.request
- The request payload.java.io.IOException
protected TableWrapper loadTable(java.lang.String content) throws java.io.IOException, RequestArgumentError
loadTable
in class ServiceArgumentsParser
content
- The table definition.TableWrapper
instance to be passed as argument to the remote call.java.io.IOException
RequestArgumentError
protected DatasetWrapper createDataset(java.lang.String name, boolean input, boolean output, boolean asHandle)
DatasetWrapper
, so that the transfer is made via XML.createDataset
in class ServiceArgumentsParser
name
- The dataset name.input
- The INPUT mode.output
- The OUTPUT mode.asHandle
- Flag indicating if this is a DATASET-HANDLE parameter.DatasetWrapper
for XML transfer.protected TableWrapper createTable(java.lang.String name, boolean input, boolean output, boolean asHandle)
TableWrapper
, so that the transfer is made via XML.createTable
in class ServiceArgumentsParser
name
- The table name.input
- The INPUT mode.output
- The OUTPUT mode.asHandle
- Flag indicating if this is a DATASET-HANDLE parameter.TableWrapper
for XML transfer.protected DatasetWrapper loadDataSet(java.lang.String content) throws java.io.IOException, RequestArgumentError
loadDataSet
in class ServiceArgumentsParser
content
- The dataset definition.DatasetWrapper
instance to be passed as argument to the remote call.java.io.IOException
RequestArgumentError
protected void notAValue(BaseDataType bdt, java.lang.String val) throws RequestArgumentError
notAValue
in class ServiceArgumentsParser
bdt
- The BDT for which the value could not be parsed.val
- The attempted value to assign.RequestArgumentError
private LegacyServiceParameter getLegacyParameter(java.lang.String source)
source
- The parameter's name.LegacyServiceParameter
from the params
map.private org.apache.axiom.om.OMElement getSoapParameter(java.lang.String source)
source
- The parameter name.private java.util.Iterator<org.apache.axiom.om.OMElement> getSoapParameters(java.lang.String source)
source
- The parameter name.private java.lang.Object createArgument(java.lang.String xsdType, java.lang.Class<?> type, java.lang.String sval) throws RequestArgumentError
BaseDataType
instance and restore its value from the given string,
based on the XSD type.xsdType
- The parameter's XSD type.type
- The BDT sub-class.sval
- The string representation of this argument.BaseDataType
or MemoryBuffer
instance for this argument.RequestArgumentError