Results 1 to 5 of 5

Thread: How using annotations with AbstractMarshallingPayloadEndpoint

  1. #1
    Join Date
    Mar 2008
    Posts
    8

    Default How using annotations with AbstractMarshallingPayloadEndpoint

    Hi,
    My problem is that i have an Endpoint class that extends AbstractMarshallingPayloadEndpoint , And i want to use many methods in the same EndPoint using annotation. i used annotation like below:

    Code:
    @Endpoint
    public class MyServiceEndpoint extends AbstractMarshallingPayloadEndpoint {
    
    	private static final Log LOG = LogFactory.getLog(MyServiceEndpoint .class);
    	public EnumEndpoint(XmlBeansMarshaller marshaller) {
    		super(marshaller);
    	}
    	@PayloadRoot(localPart = "myFirstRequest", namespace = "http://myCompany.net")
    	protected Object invokeInternal(Object loadRequest) throws Exception {
    	LOG.debug("INVOKE INTERNAL METHODE ");	
    	return null;
    	}
    
    @PayloadRoot(localPart = "mySecondRequest", namespace = "http://myCompany.net")
    	protected Object otherMethode(Object loadRequest) throws Exception {
    	LOG.debug("otherMethode ");	
    	return null;
    	}
    And i mapped thes request (mySecondRequest, myFirstRequest) in the ws-servlet.xml file
    HTML Code:
    <bean id="endpointMapping"
    		class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    		<property name="mappings">
    			<props>
    				<prop key="{http://MyCompany.net/}myFirstRequest">
    					MyServiceEndpoint
    				</prop>
    				<prop key="{http://mycompany.net/}mySecondRequest">
    					MyserviceEndPoint
    				</prop>
    .
    .
    .
    If i run it, It invoke ONLY invokeInternal() method, If some one know why it dosn't work ! , OR if you have other Idea to make it work.

    Thank u for ur tips.

    Ragards,

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    You are mixing configurations and ways to work with endpoints. Either extend the Abstract classes OR use Endpoints, don't mix them. Your current endpoint annotations are useless. Your container does nothing with them. Why?

    1. You extended the 'old' Abstract class and use annotations
    2. Your configuration doesn't tell spring to do anything with the annotations you use the old style mappings.

    I suggest that you read the Spring-WS reference guide. Especially chapter 5.4.3 which explains @Endpoint and chapter 5.5.3 which explains about the mappings.

    Next to that you probably want to take a look at the samples also.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Mar 2008
    Posts
    8

    Default

    Tank u for ur help,
    I removed extends AbstractMarshallingPayloadEndpoint from my and point and i changed the file ws-servlet.xml as folow:

    HTML Code:
    <beans >
    ........  <!-- beans declaration  -->
    
    <bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
            <constructor-arg ref="xmlBeansMarshaller"/>
        </bean>
    <bean id="xmlBeansMarshaller"
    		class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller" />
    
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"/>
    <!-- WSDL dynamic publishing -->
    .......
    
    </beans

    But Ihave this error :

    Code:
    11/04/2008 16:02:34 WARN [MessageDispatcher] : No endpoint mapping found for [Sa
    ajSoapMessage {http://myCompany.net/}myFirstRequest]
    I want to konw if i must do the mappings, or other things. And where

    Thanks again.

  4. #4
    Join Date
    Mar 2008
    Posts
    8

    Default

    For the version of spring WS I use 1.0.3, I will take the latest vertion and do the test with.

    Regards,

  5. #5
    Join Date
    Mar 2008
    Posts
    8

    Default

    Hi,
    In fact i have changed the version, but it dosn't work also with the current production release 1.5.0 of spring-ws.

    I stay waiting your help,

    Rgds,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •