ServiceT
- Subtype of Stub
representing your SOAP service.public class SoapQuery<ServiceT extends org.apache.axis2.client.Stub> extends Object
This class instantiates a service class which extends Stub
from the Axis2 framework and prepares the Axis2
configuration context according to the provided ErpConfigContext
.
Use the static method registerCustomConverter
to register your own custom converter class which Axis2 uses
for converting values from the XSD types of the SOAP envelope to Java types.
By default, the provided class SoapCustomConverter
is registered at application startup.
Constructor and Description |
---|
SoapQuery(Class<ServiceT> serviceClass)
Takes the class type of the SOAP service type
ServiceT as serviceClass , instantiates a default
ErpConfigContext , creates and prepares the Axis2 configuration context and instantiates the class
ServiceT . |
SoapQuery(Class<ServiceT> serviceClass,
ErpConfigContext configContext)
Takes the class type of the SOAP service type
ServiceT as serviceClass and an
ErpConfigContext , creates and prepares the Axis2 configuration context and instantiates the class
ServiceT . |
Modifier and Type | Method and Description |
---|---|
<ReturnT> ReturnT |
execute(io.vavr.CheckedFunction1<ServiceT,ReturnT> function)
Executes a query against a SOAP service based on the given function.
|
static void |
registerCustomConverter(Class<? extends org.apache.axis2.databinding.utils.ConverterUtil> customConverter)
Use this method to register your own custom converter class which Axis2 uses for converting values from the SOAP
envelope following XSD types to Java types.
|
public SoapQuery(@Nonnull Class<ServiceT> serviceClass, @Nonnull ErpConfigContext configContext) throws SoapException
ServiceT
as serviceClass
and an
ErpConfigContext
, creates and prepares the Axis2 configuration context and instantiates the class
ServiceT
.serviceClass
- Class type of ServiceT
configContext
- An instance of {@link ErpConfigContext}
SoapException
- Thrown in case the Axis2 configuration context could not be prepared or the service instance could
not be instantiated.public SoapQuery(@Nonnull Class<ServiceT> serviceClass) throws SoapException
ServiceT
as serviceClass
, instantiates a default
ErpConfigContext
, creates and prepares the Axis2 configuration context and instantiates the class
ServiceT
.serviceClass
- Class type of ServiceT
SoapException
- Thrown in case the Axis2 configuration context could not be prepared or the service instance could
not be instantiated.public static void registerCustomConverter(@Nonnull Class<? extends org.apache.axis2.databinding.utils.ConverterUtil> customConverter) throws SoapException
Your converter class must be a subtype of ConverterUtil
.
customConverter
- Your converter classSoapException
- Thrown in case the custom converter class could not be registered within the Axis2 framework.@Nonnull public <ReturnT> ReturnT execute(@Nonnull io.vavr.CheckedFunction1<ServiceT,ReturnT> function) throws SoapException
ReturnT
- The result type of the given function.function
- The function that calls the SOAP service and returns the relevant result.SoapException
- If there is an issue while executing the query.Copyright © 2019 SAP SE. All rights reserved.