xfire-servlet.xml ( exposing your class as a web service )

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd";>
<beans default-autowire="no" default-lazy-init="true"
default-dependency-check="none">

        <import resource="classpath:org/codehaus/xfire/spring/xfire.xml" />

        <bean
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
                <property name="urlMap">
                        <map>
                                <entry key="/myapp">
                                        <ref bean="myWebServiceExporter" />
                                </entry>
                        </map>
                </property>
        </bean>

        <bean id="myWebServiceExporter"
class="org.codehaus.xfire.spring.remoting.XFireExporter">
                <property name="serviceFactory">
                        <ref bean="xfire.serviceFactory" />
                </property>
                <property name="xfire">
                        <ref bean="xfire" />
                </property>
                <property name="serviceBean">
                        <ref bean="MyWebServiceSpringBean" />
                </property>
                <property name="serviceClass">
                        
<value>com.mycompany.myapp.interfaces.MyWebServiceInterface</value>
                </property>
        </bean>

</beans>


mywebservice-client-ws.xml ( consuming the above web service )

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE beans PUBLIC
   "-//SPRING//DTD BEAN//EN"
   "http://www.springframework.org/dtd/spring-beans.dtd";>

<beans default-autowire="no" default-lazy-init="true"
default-dependency-check="none">

        <bean id="myWebService"
class="com.mycompany.myapp.client.WebServiceProxyFactoryBean"
singleton="true" lazy-init="true">
                <property name="serviceInterface">
                        
<value>com.mycompany.myapp.interfaces.MyWebServiceInterface</value>
                </property>
                <property name="portInterface">
                        
<value>com.mycompany.myapp.interfaces.MyWebServiceRemoteInterface</value>
                </property>
                <property name="wsdlDocumentUrl">
                        <value>${myapp.wsdl.url}</value>
                </property>
                <property name="namespaceUri">
                        <value>http://interfaces.myapp.mycompany.com</value>
                </property>
                <property name="serviceName">
                        <value>MyWebServiceInterface</value>
                </property>
                <property name="portName">
                        <value>MyWebServiceInterfaceHttpPort</value>
                </property>
        </bean>

</beans>


${myapp.wsdl.url} is replaced using the Spring PropertyPlaceHolder and
the url is stored in a properties file so it can easily be switched
between dev, stage and live deployments.

Cheers,
Renier


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CTJUG 
Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/CTJUG-Forum
For the ctjug home page see http://www.ctjug.org.za
-~----------~----~----~----~------~----~------~--~---

Reply via email to