Results 1 to 3 of 3

Thread: PayloadRootQNameEndpointMapping & PayloadRootAnnotationMethodEndpointMapping together

  1. #1
    Join Date
    Dec 2006
    Posts
    6

    Default 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. #2
    Join Date
    Oct 2007
    Location
    Bangalore
    Posts
    29

    Default

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

    With Regards,
    Arun P Johny

  3. #3
    Join Date
    Dec 2006
    Posts
    6

    Default

    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!

Posting Permissions

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