org.jvnet.jax_ws_commons.spring
Class SpringService

java.lang.Object
  extended by org.jvnet.jax_ws_commons.spring.SpringService
All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean, org.springframework.web.context.ServletContextAware

public class SpringService
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean, org.springframework.web.context.ServletContextAware, org.springframework.beans.factory.InitializingBean

Endpoint. A service object and the infrastructure around it.

Author:
Kohsuke Kawaguchi

Constructor Summary
SpringService()
           
 
Method Summary
 void afterPropertiesSet()
          Called automatically by Spring after all properties have been set, including servletContext.
 com.sun.xml.ws.api.server.WSEndpoint getObject()
           
 java.lang.Class getObjectType()
           
 boolean isSingleton()
           
 void setAssembler(java.lang.Object assembler)
          Sets the TubelineAssembler or TubelineAssemblerFactory instance.
 void setBean(java.lang.Object sei)
          Sets the bean that implements the web service methods.
 void setBinding(com.sun.xml.ws.api.WSBinding binding)
          Accepts an externally configured WSBinding for advanced users.
 void setBindingID(java.lang.String id)
          Sets the binding ID, such as or .
 void setContainer(com.sun.xml.ws.api.server.Container container)
          Sets the custom Container.
 void setFeatures(java.util.List<javax.xml.ws.WebServiceFeature> features)
          WebServiceFeatures that are activated in this endpoint.
 void setHandlers(java.util.List<javax.xml.ws.handler.Handler> handlers)
          Handlers for this endpoint.
 void setImpl(java.lang.Class implType)
          Fully qualified class name of the SEI class.
 void setInvoker(com.sun.xml.ws.api.server.Invoker invoker)
          Sets Invoker for this endpoint.
 void setMetadata(java.util.Collection<java.lang.Object> metadata)
          Optional metadata for this endpoint.
 void setPortName(javax.xml.namespace.QName portName)
          Sets the port name of this endpoint.
 void setPrimaryWsdl(java.lang.Object primaryWsdl)
          Optional WSDL for this endpoint.
 void setResolver(org.xml.sax.EntityResolver resolver)
          Sets the EntityResolver to be used for resolving schemas/WSDLs that are referenced.
 void setServiceName(javax.xml.namespace.QName serviceName)
          Sets the service name of this endpoint.
 void setServletContext(javax.servlet.ServletContext servletContext)
          Set automatically by Spring if JAX-WS is used inside web container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringService

public SpringService()
Method Detail

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Set automatically by Spring if JAX-WS is used inside web container.

Specified by:
setServletContext in interface org.springframework.web.context.ServletContextAware

setImpl

public void setImpl(java.lang.Class implType)
Fully qualified class name of the SEI class. Required.


setBean

public void setBean(java.lang.Object sei)
Sets the bean that implements the web service methods.


setInvoker

public void setInvoker(com.sun.xml.ws.api.server.Invoker invoker)
Sets Invoker for this endpoint. Defaults to the standard invoker.


setAssembler

public void setAssembler(java.lang.Object assembler)
Sets the TubelineAssembler or TubelineAssemblerFactory instance.

This is an advanced configuration option for those who would like to control what processing JAX-WS runtime performs. The default value is null, in which case the TubelineAssemblerFactory is looked up from the META-INF/services.


setServiceName

public void setServiceName(javax.xml.namespace.QName serviceName)
Sets the service name of this endpoint. Defaults to the name inferred from the impl attribute.


setPortName

public void setPortName(javax.xml.namespace.QName portName)
Sets the port name of this endpoint. Defaults to the name inferred from the impl attribute.


setContainer

public void setContainer(com.sun.xml.ws.api.server.Container container)
Sets the custom Container. Optional.


setBinding

public void setBinding(com.sun.xml.ws.api.WSBinding binding)
Accepts an externally configured WSBinding for advanced users.


setBindingID

public void setBindingID(java.lang.String id)
Sets the binding ID, such as or .

If none is specified, BindingType annotation on SEI is consulted. If that fails, SOAPBinding.SOAP11HTTP_BINDING.

See Also:
SOAPBinding.SOAP11HTTP_BINDING, SOAPBinding.SOAP12HTTP_BINDING, HTTPBinding.HTTP_BINDING

setFeatures

public void setFeatures(java.util.List<javax.xml.ws.WebServiceFeature> features)
WebServiceFeatures that are activated in this endpoint.


setHandlers

public void setHandlers(java.util.List<javax.xml.ws.handler.Handler> handlers)
Handlers for this endpoint. Note that the order is significant.

If there's just one handler and that handler is declared elsewhere, you can use this as a nested attribute like handlers="#myHandler". Or otherwise a nested <bean> or <ref> tag can be used to specify multiple handlers.


setPrimaryWsdl

public void setPrimaryWsdl(java.lang.Object primaryWsdl)
                    throws java.io.IOException
Optional WSDL for this endpoint.

Defaults to the WSDL discovered in META-INF/wsdl,

It can be either String, URL, or SDDocumentSource.

If primaryWsdl is a String, ServletContext (if available) and ClassLoader are searched for this path, then failing that, it's treated as an absolute URL.

Throws:
java.io.IOException

setMetadata

public void setMetadata(java.util.Collection<java.lang.Object> metadata)
Optional metadata for this endpoint.

The collection can contain String, URL, or SDDocumentSource elements.

If element is a String, ServletContext (if available) and ClassLoader are searched for this path, then failing that, it's treated as an absolute URL.


setResolver

public void setResolver(org.xml.sax.EntityResolver resolver)
Sets the EntityResolver to be used for resolving schemas/WSDLs that are referenced. Optional.

If omitted, the default catalog resolver is created by looking at /WEB-INF/jax-ws-catalog.xml (if we run as a servlet) or /META-INF/jax-ws-catalog.xml (otherwise.)


getObject

public com.sun.xml.ws.api.server.WSEndpoint getObject()
                                               throws java.lang.Exception
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean
Throws:
java.lang.Exception

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Called automatically by Spring after all properties have been set, including servletContext. This implementation creates SDDocumentSources from the primaryWSDLResource and metadataResources properties, if provided.

See #setMetadata(java.util.Collection) and setPrimaryWsdl(Object) for conversion rules.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception - if an error occurs while creating SDDocumentSources from the primaryWSDLResource and metadataResources properties
See Also:
resolveSDDocumentSource(Object)

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean

getObjectType

public java.lang.Class getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean


Copyright © 2008. All Rights Reserved.