Announcement Announcement Module
Collapse
No announcement yet.
How using annotations with AbstractMarshallingPayloadEndpoint Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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.

      Comment


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

        Regards,

        Comment


        • #5
          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,

          Comment

          Working...
          X