Announcement Announcement Module
Collapse
No announcement yet.
PayloadRootQNameEndpointMapping & PayloadRootAnnotationMethodEndpointMapping together Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • PayloadRootQNameEndpointMapping & PayloadRootAnnotationMethodEndpointMapping together

    Hello,

    I am trying to use two different mapping styles at the same time, not sure if that is allowed but is surely not working. Maybe my setup is wrong.

    So if I just put one service with PayloadRootQNameEndpointMapping it works fine. If I add the second service with PayloadRootAnnotationMethodEndpointMapping then only the second one works and I get an error message for the first one: No adapter for endpoint xyzEndpoint. Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint?


    The first one is like this:
    Code:
    <bean id="disseminationEndpoint" class="...DisseminationEndpoint" />
    
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
      <property name="mappings">
      ...
    The second one is:
    Code:
    <bean id="corporationEndpoint" class="...CorporationEndpoint" />
    
    <bean id="marshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller" />
    
    <bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
      <constructor-arg ref="marshaller"/>
    </bean>
    
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping" />
    While debugging it at the point where exception is thrown - MessageDispatcher.getEndpointAdapter(Object endpoint) - endpointAdapters will either have 4 elements (MessageEndpointAdapter, PayloadEndpointAdapter, MessageMethodEndpointAdapter, PayloadMethodEndpointAdapter) if I only have the first service. If I add the second service then endpointAdapters will only have 1 element (GenericMarshallingMethodEndpointAdapter)

    Why can't they co-exist? Anything I can do to make them work at the same time? It may be untypical to do this but I do need it. I am using spring-ws-1.5.9.

  • #2
    Originally posted by ziimen View Post
    Hello,

    I am trying to use two different mapping styles at the same time, not sure if that is allowed but is surely not working. Maybe my setup is wrong.

    So if I just put one service with PayloadRootQNameEndpointMapping it works fine. If I add the second service with PayloadRootAnnotationMethodEndpointMapping then only the second one works and I get an error message for the first one: No adapter for endpoint xyzEndpoint. Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint?


    The first one is like this:
    Code:
    <bean id="disseminationEndpoint" class="...DisseminationEndpoint" />
    
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
      <property name="mappings">
      ...
    The second one is:
    Code:
    <bean id="corporationEndpoint" class="...CorporationEndpoint" />
    
    <bean id="marshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller" />
    
    <bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
      <constructor-arg ref="marshaller"/>
    </bean>
    
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping" />
    While debugging it at the point where exception is thrown - MessageDispatcher.getEndpointAdapter(Object endpoint) - endpointAdapters will either have 4 elements (MessageEndpointAdapter, PayloadEndpointAdapter, MessageMethodEndpointAdapter, PayloadMethodEndpointAdapter) if I only have the first service. If I add the second service then endpointAdapters will only have 1 element (GenericMarshallingMethodEndpointAdapter)

    Why can't they co-exist? Anything I can do to make them work at the same time? It may be untypical to do this but I do need it. I am using spring-ws-1.5.9.
    If there are no EndpointAdapters specified in your context spring will create the 4 EndPoint adapters itself.
    But in your second case your context contains the GenericMarshallingMethodEndpointAdapter, so spring will not create the default adapters. What you have to do is to create all the required adapters manually in your context. I think you need to create instances of PayloadEndpointAdapter/PayloadMethodEndpointAdapter. I'm not sure which one is needed.

    Can you try to create these adapter instances along with the GenericMarshallingMethodEndpointAdapter in your context.

    Comment


    • #3
      You nailed it. The first service endpoint is an extension of MessageEndpoint so adding a MessageEndpointAdapter made it work. I guess I was mislead with spring being nice when no adapters are specified it will create some. Maybe it shouldn't do that.

      Either way, thanks man!

      Comment

      Working...
      X