@ComponentProfile(summary="Execute a webservice using CXF", tag="service,webservices,cxf") public class ApacheSoapService extends ServiceImp
SOAP Service Requester that will invoke a webservice using the payload of the message as the operation argument (the service looks after the SOAP envelope).
Note that this service attempts to set the system property org.apache.cxf.stax.allowInsecureParser
to 1 to remove
the dependency on the woodstox stax implementation. Woodstox causes an incompatibility with XStream when it comes to
unmarshalling CDATA tags, which can present problems if you are embedding XML as part of PollingTrigger
or PayloadFromMetadataService
in your adapter configuration. This will cause a
warning in the log file which can be safely ignored.
If you wish to use woodstox, then explicitly set the property to your preferred value (probably false
)as the service
will only attempt to set it if it has not already been set.
In the adapter configuration file this class is aliased as apache-cxf-soap-service which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Class and Description |
---|---|
protected static interface |
ApacheSoapService.ConfigItem |
protected static interface |
ApacheSoapService.DispatchBuilder |
static class |
ApacheSoapService.DispatchConfig |
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
ApacheSoapService() |
Modifier and Type | Method and Description | ||
---|---|---|---|
protected void |
closeService() |
||
void |
doService(AdaptrisMessage msg) |
||
protected java.lang.String |
endpointAddress() |
||
TimeInterval |
getConnectionTimeout()
The time to wait for a connection to this service invocation.
|
||
java.lang.Boolean |
getEnableDebug()
Deprecated.
since 3.8.2; use log4j/slf4j/java.util.logging to get debug logging c.f.
java.lang.String getEndpointAddress() | ||
java.lang.String |
getNamespace()
The namespace of this Service.
|
||
java.lang.String |
getPassword()
Optional password for HTTP basic authentication.
|
||
java.lang.Boolean |
getPerMessageDispatch() |
||
java.lang.String |
getPortName()
The port name for the WSDL.
|
||
TimeInterval |
getRequestTimeout()
The time to wait for a request completion for this service invocation.
|
||
java.lang.String |
getServiceName()
The name of the Service to be invoked.
|
||
java.lang.String |
getSoapAction()
The SOAP Action to be used.
|
||
java.lang.String |
getUsername()
Optional username for HTTP basic authentication.
|
||
java.lang.String |
getWsdlPortUrl()
Deprecated.
since 3.8.2; use
getEndpointAddress() instead as this matches the
BindingProvider#ENDPOINT_ADDRESS_PROPERTY better. |
||
java.lang.String |
getWsdlUrl()
The URL from which to download the WSDL.
|
||
protected void |
initService() |
||
void |
prepare() |
||
void |
setConnectTimeout(TimeInterval ti)
The time to wait for a connection to this service invocation.
|
||
void |
setEnableDebug(java.lang.Boolean b)
Deprecated.
since 3.8.2; use log4j/slf4j/java.util.logging to get debug logging c.f.
void setEndpointAddress(java.lang.String endpointAddress) | ||
void |
setNamespace(java.lang.String namespace)
The namespace of this Service.
|
||
void |
setPassword(java.lang.String pw)
Optional password for HTTP basic authentication.
|
||
void |
setPerMessageDispatch(java.lang.Boolean b)
Set this to true if you want to dynamically resolve
getSoapAction() , getUsername() , getPassword()
and getEndpointAddress() dynamically from the message using the standard expression syntax. |
||
void |
setPortName(java.lang.String portName)
The port name for the WSDL.
|
||
void |
setRequestTimeout(TimeInterval rt)
The time to wait for a request completion for this service invocation.
|
||
void |
setServiceName(java.lang.String serviceName)
The name of the Service to be invoked.
|
||
void |
setSoapAction(java.lang.String soapAction)
The SOAP Action to be used.
|
||
void |
setUsername(java.lang.String username)
Optional username for HTTP basic authentication.
|
||
void |
setWsdlPortUrl(java.lang.String wsdlPortUrl)
Deprecated.
since 3.8.2; use
setEndpointAddress(String) instead as this matches the
BindingProvider#ENDPOINT_ADDRESS_PROPERTY better. |
||
void |
setWsdlUrl(java.lang.String wsdlUrl)
The URL from which to download the WSDL.
|
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsConfirmation, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isConfirmation, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, rethrowServiceException, retrieveComponentState, setContinueOnFail, setIsConfirmation, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
protected void closeService()
closeService
in class ServiceImp
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
public void doService(AdaptrisMessage msg) throws ServiceException
ServiceException
public void prepare() throws CoreException
CoreException
public java.lang.String getWsdlUrl()
public void setWsdlUrl(java.lang.String wsdlUrl)
wsdlUrl
- public java.lang.String getPortName()
public void setPortName(java.lang.String portName)
portName
- public java.lang.String getServiceName()
public void setServiceName(java.lang.String serviceName)
serviceName
- public java.lang.String getNamespace()
public void setNamespace(java.lang.String namespace)
namespace
- public java.lang.String getSoapAction()
public void setSoapAction(java.lang.String soapAction)
soapAction
- @Deprecated @Removal(version="3.10.0") public java.lang.String getWsdlPortUrl()
getEndpointAddress()
instead as this matches the
BindingProvider#ENDPOINT_ADDRESS_PROPERTY
better.@Deprecated @Removal(version="3.10.0") public void setWsdlPortUrl(java.lang.String wsdlPortUrl)
setEndpointAddress(String)
instead as this matches the
BindingProvider#ENDPOINT_ADDRESS_PROPERTY
better.wsdlPortUrl
- public java.lang.String getEndpointAddress()
public void setEndpointAddress(java.lang.String endpointAddress)
protected java.lang.String endpointAddress()
@Deprecated @Removal(version="3.10.0") public java.lang.Boolean getEnableDebug()
@Deprecated @Removal(version="3.10.0") public void setEnableDebug(java.lang.Boolean b)
b
- true = provide web service debug informationpublic TimeInterval getConnectionTimeout()
public void setConnectTimeout(TimeInterval ti)
ti
- the connect timeout, if unspecified defaults to 10 secondspublic TimeInterval getRequestTimeout()
public void setRequestTimeout(TimeInterval rt)
rt
- the request timeout, if unspecified defaults to 50 seconds.public java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- public java.lang.String getPassword()
public void setPassword(java.lang.String pw)
pw
- the password which may be encoded by Password.encode(String, String)
public java.lang.Boolean getPerMessageDispatch()
public void setPerMessageDispatch(java.lang.Boolean b)
getSoapAction()
, getUsername()
, getPassword()
and getEndpointAddress()
dynamically from the message using the standard expression syntax.
Note that setting this to true, will cause a new Dispatch
object to be created during every
doService(AdaptrisMessage)
method, this may incur a high cost of initialisation.
b
- true to enable, default is false.