Hi,
I am trying to use the @Endpoint and @PayloadRoot annotations and am having a bit of difficulty...
I have a class that is annotated as follows:
my spring-ws-servlet.xml is set as follows:Code:@Endpoint public class ProfilerImpl implements Profiler { private static Log log = LogFactory.getLog(Profiler.class); @Autowired private DirectoryService directoryService; @Autowired private NetworkService networkService; @Autowired private BillingService billingService; @PayloadRoot(localPart="getDirectoryProfile", namespace="http://www.company.com/profile") public Profile getDirectoryProfile(Profile profile) { ... } @PayloadRoot(localPart="getNetworkProfile", namespace="http://www.company.com/profile") public Profile getNetworkProfile(Profile profile) { ... } @PayloadRoot(localPart="validateAccountAssociations", namespace="http://www.company.com/profile") public Profile validateAccountAssociations(Profile profile) { ... } }
When the wsdl is produced, there are no operations...Code:<bean id="profilerEndpoint" class="com.company.aggregate.profile.device.ProfilerImpl" /> <bean id="endpointAdapter" class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter"> <constructor-arg ref="marshaller" /> </bean> <oxm:jibx-marshaller id="marshaller" target-class="com.company.aggregate.profile.device.Profile"/> <bean id="profileDevice" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition"> <property name="schemaCollection" ref="schemaCollection" /> <property name="portTypeName" value="ProfileDevice" /> <property name="locationUri" value="/services/" /> <property name="targetNamespace" value="http://www.company.com/information/services" /> </bean> <bean id="schemaCollection" class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection"> <property name="xsds"> <list> <value>/WEB-INF/classes/values.xsd</value> <value>/WEB-INF/classes/directory.xsd</value> <value>/WEB-INF/classes/device.xsd</value> </list> </property> <property name="inline" value="true" /> </bean>
if I add the PayloadRootAnnotationMethodEndpointMapping to the above configuration:
I get the following errors:Code:<bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"/>
Code:<Sep 22, 2009 4:06:50 PM GMT-05:00> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@25191a3 - appName: 'comcast-aggregate-profile-device', name: 'comcast-aggregate-profile-device-0.0.1-SNAPSHOT.war', context-path: '/comcast-aggregate-profile-device', spec-version: '2.5', request: weblogic.servlet.internal.ServletRequestImpl@2bc543c[ GET /comcast-aggregate-profile-device/services/profileDevice.wsdl HTTP/1.1 User-Agent: Jakarta Commons-HttpClient/3.0.1 ]] Root cause of ServletException. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping#0' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.context.ApplicationContextException: Cannot map endpoint [public com.comcast.aggregate.profile.device.Profile com.comcast.aggregate.profile.device.ProfilerImpl.getDirectoryProfile(com.comcast.aggregate.profile.device.Profile)] on registration key [{http://www.comcast.com/profile}getDirectoryProfile]: there's already endpoint [public com.comcast.aggregate.profile.device.Profile com.comcast.aggregate.profile.device.ProfilerImpl.getDirectoryProfile(com.comcast.aggregate.profile.device.Profile)] mapped at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) Truncated. see log file for complete stacktrace org.springframework.context.ApplicationContextException: Cannot map endpoint [public com.comcast.aggregate.profile.device.Profile com.comcast.aggregate.profile.device.ProfilerImpl.getDirectoryProfile(com.comcast.aggregate.profile.device.Profile)] on registration key [{http://www.comcast.com/profile}getDirectoryProfile]: there's already endpoint [public com.comcast.aggregate.profile.device.Profile com.comcast.aggregate.profile.device.ProfilerImpl.getDirectoryProfile(com.comcast.aggregate.profile.device.Profile)] mapped at org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping.registerEndpoint(AbstractMethodEndpointMapping.java:93) at org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping$2.doWith(AbstractMethodEndpointMapping.java:141) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:466) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:443) at org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping.registerMethods(AbstractMethodEndpointMapping.java:136) Truncated. see log file for complete stacktrace >
I tried removing the <context:annotation-config /> declaration but that did not seem to correct the issue? What is the correct way to establish the endpoint mapping when using annotation configuration?
Thanks.
Keith


Reply With Quote