Results 1 to 4 of 4

Thread: No adapter for endpoint error when using XPathParamAnnotationMethodEndpointAdapter

Hybrid View

  1. #1

    Default 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. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    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).
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3

    Default

    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.

  4. #4
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

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

    Spring Web Services Dev Lead
    Please read the FAQ

Posting Permissions

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