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

<beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:aop="http://www.springframework.org/schema/aop"
     xmlns:tx="http://www.springframework.org/schema/tx"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:mvc="http://www.springframework.org/schema/mvc"
     xmlns:sws="http://www.springframework.org/schema/web-services"
     xmlns:p="http://www.springframework.org/schema/p"
     xmlns:task="http://www.springframework.org/schema/task"
     xsi:schemaLocation="
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
     http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
     http://www.springframework.org/schema/context     
     http://www.springframework.org/schema/context/spring-context-3.2.xsd
     http://www.springframework.org/schema/task
   	 http://www.springframework.org/schema/task/spring-task-3.2.xsd
     http://www.springframework.org/schema/web-services
     http://www.springframework.org/schema/web-services/web-services-2.0.xsd">
     
    <context:annotation-config/>
     
    <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"/>
    <bean id="messageSender" class="org.springframework.ws.transport.http.CommonsHttpMessageSender">
     		<property name="connectionTimeout" value="60000" />
            <property name="readTimeout" value="60000" />  
            <!--  <property name="credentials">
                <bean class="org.apache.commons.httpclient.UsernamePasswordCredentials">
                    <constructor-arg value="user_name"/>
                    <constructor-arg value="Password"/>
                </bean>
            </property>-->          
    </bean>
    
    <!-- For multiple service separate package name with : example: pakcage1:package2:package3 -->
    <bean id="stockJaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller" p:contextPath="generated.webClient.stock"/> 
	
    <bean id="stockTemplate" class="org.springframework.ws.client.core.WebServiceTemplate" 
          p:marshaller-ref="stockJaxbMarshaller" 
          p:unmarshaller-ref="stockJaxbMarshaller" 
          p:defaultUri="http://www.webservicex.net/stockquote.asmx" 
          p:messageSender-ref="messageSender">
          <constructor-arg ref="messageFactory"/> 
    </bean>
     
</beans>