org.jboss.soa.esb.actions.soap
Class AbstractWsdlContractPublisher

java.lang.Object
  extended by org.jboss.soa.esb.actions.soap.AbstractWsdlContractPublisher
All Implemented Interfaces:
org.jboss.internal.soa.esb.publish.ActionContractPublisher, org.jboss.internal.soa.esb.publish.ContractPublisher, org.jboss.internal.soa.esb.publish.Publisher, org.jboss.internal.soa.esb.publish.ServletContractPublisher
Direct Known Subclasses:
JBossWSWebserviceContractPublisher, WsdlContractPublisher

public abstract class AbstractWsdlContractPublisher
extends java.lang.Object
implements org.jboss.internal.soa.esb.publish.ActionContractPublisher, org.jboss.internal.soa.esb.publish.ServletContractPublisher

Abstract WSDL contract publisher.

Author:
tom.fennelly@jboss.com

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.internal.soa.esb.publish.ActionContractPublisher
org.jboss.internal.soa.esb.publish.ActionContractPublisher.ProxyFactory
 
Field Summary
static java.lang.String CACHE_SCHEMAS
           
static java.lang.String REWRITE_ENDPOINT_URL
           
 
Constructor Summary
AbstractWsdlContractPublisher()
           
 
Method Summary
 java.util.Properties getActionProperties()
          Get the action properties.
 org.jboss.internal.soa.esb.publish.ContractInfo getContractInfo(EPR epr)
          Get the contract configuration.
 org.jboss.internal.soa.esb.publish.ContractInfo getContractInfo(EPR epr, javax.servlet.http.HttpServletRequest servletRequest)
          Get the contract information within a servlet context.
 org.jboss.internal.soa.esb.publish.ContractInfo getContractInfo(Service service, java.lang.String wsdlAddress)
           
abstract  java.util.Properties getHttpClientProperties()
          Get the HttpClientFactory properties.
 java.lang.String getWsdl(java.lang.String wsdlAddress)
          Get the WSDL.
 java.lang.String getWsdl(java.lang.String wsdlAddress, java.lang.String charsetNameOverride)
          Get the WSDL.
abstract  java.lang.String getWsdlAddress()
          Get the WSDL Address.
protected  void initialize(java.util.Properties actionProperties)
          Initialize this publisher using the action properties.
protected  void initializeTransformer()
          Initialize the endpoint rewriting transformer.
 void setActionConfig(Action actionConfig)
          Set the SOAPProcessor action configuration.
protected  void setActionProperties(java.util.Properties actionProperties)
          Set the action properties.
protected  java.lang.String updateWsdl(java.lang.String wsdl, EPR epr, java.lang.String targetServiceCat, java.lang.String targetServiceName, java.lang.String targetProtocol)
          Update the supplied wsdl to take account of the ESB endpoint proxying of the JBossWS invocation, as well as the fact that the transport may be different.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_SCHEMAS

public static final java.lang.String CACHE_SCHEMAS
See Also:
Constant Field Values

REWRITE_ENDPOINT_URL

public static final java.lang.String REWRITE_ENDPOINT_URL
See Also:
Constant Field Values
Constructor Detail

AbstractWsdlContractPublisher

public AbstractWsdlContractPublisher()
Method Detail

initialize

protected void initialize(java.util.Properties actionProperties)
                   throws ConfigurationException
Initialize this publisher using the action properties.

Parameters:
actionProperties - The action properties.
Throws:
ConfigurationException - Bad config.

setActionConfig

public void setActionConfig(Action actionConfig)
                     throws ConfigurationException
Set the SOAPProcessor action configuration.

Specified by:
setActionConfig in interface org.jboss.internal.soa.esb.publish.ActionContractPublisher
Parameters:
actionConfig - action config.
Throws:
ConfigurationException - Bad config.

getActionProperties

public java.util.Properties getActionProperties()
Get the action properties.

Returns:
The action properties.

setActionProperties

protected void setActionProperties(java.util.Properties actionProperties)
Set the action properties.


getWsdlAddress

public abstract java.lang.String getWsdlAddress()
Get the WSDL Address.

Returns:
The WSDL address.

getHttpClientProperties

public abstract java.util.Properties getHttpClientProperties()
Get the HttpClientFactory properties.

We use HttpClient (configurable via the HttpClientFactory) to load the WSDL. This way, we can support different auth mechanisms etc.

Returns:
The HttpClientFactory properties.

getContractInfo

public org.jboss.internal.soa.esb.publish.ContractInfo getContractInfo(EPR epr)
Get the contract configuration.

This method impl basically returns the Endpoint WSDL, modified for the supplied EPR and its channel.

Specified by:
getContractInfo in interface org.jboss.internal.soa.esb.publish.ContractPublisher
Parameters:
epr - Endpoint EPR.
Returns:
WSDL Contract.

getContractInfo

public org.jboss.internal.soa.esb.publish.ContractInfo getContractInfo(EPR epr,
                                                                       javax.servlet.http.HttpServletRequest servletRequest)
Description copied from interface: org.jboss.internal.soa.esb.publish.ServletContractPublisher
Get the contract information within a servlet context.

A Service may publish a number of addressable endpoints. The publisher will likely return different contract info depending on the endpoint EPR.

This info can be stored and published from a global registry of some sort.

Specified by:
getContractInfo in interface org.jboss.internal.soa.esb.publish.ServletContractPublisher
Parameters:
epr - Endpoint EPR.
servletRequest - The servlet request context.
Returns:
Contract information.

getContractInfo

public org.jboss.internal.soa.esb.publish.ContractInfo getContractInfo(Service service,
                                                                       java.lang.String wsdlAddress)
                                                                throws java.io.IOException
Throws:
java.io.IOException

getWsdl

public java.lang.String getWsdl(java.lang.String wsdlAddress)
                         throws java.io.IOException
Get the WSDL.

Parameters:
wsdlAddress - The WSDL address.
Returns:
The WSDL.
Throws:
java.io.IOException - Error reading wsdl.

getWsdl

public java.lang.String getWsdl(java.lang.String wsdlAddress,
                                java.lang.String charsetNameOverride)
                         throws java.io.IOException
Get the WSDL.

Parameters:
wsdlAddress - The WSDL address.
charsetNameOverride - The charset name override.
Returns:
The WSDL.
Throws:
java.io.IOException - Error reading wsdl.

updateWsdl

protected java.lang.String updateWsdl(java.lang.String wsdl,
                                      EPR epr,
                                      java.lang.String targetServiceCat,
                                      java.lang.String targetServiceName,
                                      java.lang.String targetProtocol)
                               throws org.xml.sax.SAXException,
                                      java.io.IOException,
                                      ConfigurationException
Update the supplied wsdl to take account of the ESB endpoint proxying of the JBossWS invocation, as well as the fact that the transport may be different.

Parameters:
wsdl - WSDL input.
epr - The SOAP endpoint from the ESB perspective.
targetServiceCat -
targetServiceName -
targetProtocol - @return The updated WSDL.
Throws:
org.xml.sax.SAXException
java.io.IOException
ConfigurationException

initializeTransformer

protected void initializeTransformer()
                              throws ConfigurationException
Initialize the endpoint rewriting transformer.

Throws:
ConfigurationException - Failed to initialize transformer.