I am trying to make two testcases using class org.springframework.ws.client.core.WebServiceTemplate. Both testcases are in different classes so I made two different beans for them.
On running the junit tests I got a error like that
Error creating bean with name ‘testcases.TestAdminMethodsWebService’:
Unsatisfied dependency expressed through bean property ‘admin’: : No
unique bean of type
[org.springframework.ws.client.core.WebServiceTemplate] is defined:
expected single matching bean but found 7: [admin, rules]; nested
exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
unique bean of type
[org.springframework.ws.client.core.WebServiceTemplate] is defined:
expected single matching bean but found 2: [admin, rules]
My bean is like this:
<oxm:jaxb2-marshaller id="marshaller_admin" contextPath="a.com.b" />
<bean id="admin" class="org.springframework.ws.client.core.WebServiceTemplate">
<property name="marshaller" ref="marshaller_admin" />
<property name="unmarshaller" ref="marshaller_admin" />
<property name="defaultUri"
value="http://dev05:8080/.." />
</bean>
<oxm:jaxb2-marshaller id="marshaller_rules" contextPath="r.com.b" />
<bean id="rules" class="org.springframework.ws.client.core.WebServiceTemplate">
<property name="marshaller" ref="marshaller_rules" />
<property name="unmarshaller" ref="marshaller_rules" />
<property name="defaultUri"
value="http://dev05:8080/.." />
</bean>
please tell me how to overcome with this problem or why this error occurs any help will be appreciated thank you.
Hello this is the right answer
}