-
Jun 27th, 2007, 11:03 AM
#1
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>
-
Jun 27th, 2007, 07:23 PM
#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).
-
Jun 28th, 2007, 03:47 AM
#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><OrderSendRequest></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.
-
Jun 29th, 2007, 07:10 AM
#4
Exactly. For instance, when Order is a class "known" to a marshaller (generated by xjc, for instance), you could use the MarshallingMethodEndpointAdapter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules