Announcement Announcement Module
Collapse
No announcement yet.
No adapter for endpoint error when using XPathParamAnnotationMethodEndpointAdapter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No adapter for endpoint error when using XPathParamAnnotationMethodEndpointAdapter

    When testing my web service on the soapui client i get this in the response:
    No adapter for endpoint [public javax.xml.transform.Source org.springframework.ws.samples.airline.ws.OrderEnd point.messageRecall(int) throws org.springframework.ws.samples.airline.service.Man agementException,javax.xml.bind.JAXBException]: Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint?</faultstring>
    </SOAP-ENV:Fault>

    I have an OrderEndpoint that uses the @XPathParam and @PayloadRoot.I also have the adapters and endpoint mappings defined in the spring-ws-servlet.xml and have the appropriate .jars in my web-inf/lib.

    Following is a part of the spring-ws-servlet.xml i have written:


    <bean id="OrderEndpoint" class="org.springframework.ws.samples.airline.ws.O rderEndpoint">
    <constructor-arg ref="orderService"/>
    <constructor-arg ref="marshaller"/>
    </bean>

    <bean id="orderService" class="org.springframework.ws.samples.airline.serv ice.impl.OrderServiceImpl"/>

    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="contextPath" value="org.springframework.ws.samples.airline.sche ma"/>
    </bean>




    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping">
    </bean>

    <bean class="org.springframework.ws.server.endpoint.adap ter.XPathParamAnnotationMethodEndpointAdapter">
    <description>
    This adapter allows for methods that use @XPathParam annotations. The XPathAirlineEndpoint uses JAXB2 these.
    </description>
    <property name="namespaces">
    <props>
    <prop key="tns">http://monitise.com/types/MWSEndpointIntf</prop>
    </props>
    </property>
    </bean>

  • #2
    Hi,

    @XPathParam does not work on int parameters, only on types supported by xpath itself (which means doubles for numbers). It's mentioned in the javadoc here (Linking to the Google cache, since it appears static.springframework.org is down for the moment).

    Comment


    • #3
      Hi Arjen,
      Thanks for the reply but this is the method i am using:

      /**
      * This endpoint method uses XPath to handle message with a <code>&lt;OrderSendRequest&gt;</code> payload.
      *
      * @param id id
      * @param message message
      */
      @PayloadRoot(localPart ="OrderSendRequest", namespace = "http://order.com/types/OrderEndpointIntf")
      public Source orderSend(@XPathParam("//tns:id")String id,@XPathParam("//tns:message")Order order) throws OrderException,JAXBException {


      String orderId= orderService.orderSend(id,message);

      OrderSendResponse response = objectFactory.createOrderSendResponse(id);
      return new MarshallingSource(marshaller, response);
      }

      So u mean to say that XPath cannot be used in the above case cause im using a user defined type Order.Is that the reason im getting that error message ,so i guess i would have to use antoher endpoint adapter.

      Comment


      • #4
        Exactly. For instance, when Order is a class "known" to a marshaller (generated by xjc, for instance), you could use the MarshallingMethodEndpointAdapter

        Comment

        Working...
        X