Announcement Announcement Module
No announcement yet.
Problem with changing from XML endpoint mapping to annotation based endpoints Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with changing from XML endpoint mapping to annotation based endpoints


    I have a WebService configured via XML with enpoints derived from AbstractDomPayloadEndpoint. Now I would like to change it to annotation based configuration of endpoints, but the entpoint method never gets called.

    First, here are the important parts (bean definitions) of my current working setup:

    <bean id="messageFactory" class="" />
    <bean id="messageReceiver" class="">
      <property name="endpointMappings" ref="endpointMapping" />
    <bean id="endpointMapping" class="">
      <property name="mappings">
          <prop key="{}createFooRequest">createFooRequestEndpoint</prop>
    <bean id="createFooRequestEndpoint" class="" />
    <bean id="soapHandler" class="">
      <property name="messageFactory" ref="messageFactory" />
      <property name="messageReceiver" ref="messageReceiver" />
    <bean id="wsdlHandler" class="">
      <property name="definition" ref="wsdlDefinition" />
    (some missing beans are not shown just for clarity reasons)

    Now we can see that the full qualified name of a WebService request is:

    Now here is the class that acts as an endpoint:

    public class CreateFooRequestEndpoint extends AbstractDomPayloadEndpoint {
      protected Element invokeInternal( Element element, Document document ) throws Exception {
        System.out.println( "invokeInternal" );
        return null;
    This works without problems, as soon as I send a SOAP message with the "{}createFooRequest", the "invokeInternal" method of the "CreateFooRequestEndpoint" class gets invoked.

    Now I would like to do it via annotations - and this is what I can't get working.

    I changed the endpointMapping Bean this way:

    <bean id="endpointMapping" class="">
      <property name="defaultEndpoint" ref="dataServiceEndpoint" />
    <bean id="dataServiceEndpoint" class="" />
    My "dataServiceEndpoint" looks like this:

    public class DataServiceEndpoint {
      // Remember: the full qualified request name should be:
      // {}createFooRequest
      @PayloadRoot( localPart = "createFooRequest", namespace = "" )
      public Element createFoo( Element element, Document document ) {
        System.out.println( "DataServiceEndpoint.createMission" );
        return null;

    When I now call the webservice, no console output is generated, the "DataServiceEndpoint.createFoo" method never gets called. Instead, I get the following SOAP fault:

      <faultstring xml:lang="en">No adapter for endpoint [[email protected]]: Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint?</faultstring>
    My endpoint (with the annotaion style) does not implement a MessageHandler or PayloadEndpoint, of course. I don't know, if the fault message is just not yet prepared to give annotation-failure hints.

    So, to make a long story short, I have the following two questions:

    1. Is the method signature of "DataServiceEndpoint.createFoo" correct? I always see examples which use marshalling, so the "createFoo" method should take a "FooRequest" object as the only parameter. Do I have to use marshalling, or if not, what must the formal parameters look like for the "createFooRequest" method?

    2. What else might be wrong, do I have to configure some other beans?

    Thanks a lot for your help!

    Best regards,

  • #2
    I figured it out myself - of course, I need to use the "PayloadRootAnnotationMethodEndpointMapping" class so annotations can be detected.