ServiceT
- Subtype of Stub
representing your SOAP service.public class SoapRequest<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 Destination
.
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 |
---|
SoapRequest(Class<ServiceT> serviceClass,
Destination destination)
Takes the class type of the SOAP service type
ServiceT as serviceClass and an
Destination , 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 request 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 SoapRequest(@Nonnull Class<ServiceT> serviceClass, @Nonnull Destination destination) throws SoapException
ServiceT
as serviceClass
and an
Destination
, creates and prepares the Axis2 configuration context and instantiates the class
ServiceT
.serviceClass
- Class type of ServiceT
destination
- An instance of {@link Destination }
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 request.Copyright © 2020 SAP SE. All rights reserved.