Hi,
I tried to implement some scenario, when the endpoint mapping is URI suffix dependent.
I have a pretty untypical endpoint, that accepts some JDom Element, and return a Source - and this works perfectly when used together with @PayloadRoot(localPart = "myRequest", namespace = "http://www.example.org/sample") annotation + sws:annotation-driven, probably with help of JDomPayloadMethodProcessor + DefaultMethodEndpointAdapter registered by sws:annotation-driven instruction.
I expected no difference after adding my custom endpoint mapping, cause I though the adapters will be registered as they were. I have just ensured that my mapping is executed first, by using -100 in the order.
The endpoint is something like:Code:... <sws:annotation-driven /> <bean class="my.test.URISuffixEndpointMapping"> <property name="suffixMappings"> <list> <bean class="my.test.URISuffixEndpointMapping$URISuffixToEndpointMappingEntry"> <property name="suffix" value="/VerySpecialSuffix"/> <property name="endpoint" ref="jdom-test-endpoint"/> </bean> </list> </property> <property name="order" value="-100"/> </bean> <bean id="test-endpoint" class="example.TestEndpoint"/> <bean id="jdom-test-endpoint" class="example.JDomTestEndpoint"/> ...
To my surprise this however does not work, saying that it cannot fidn an EndpointAdapter for my endpoint. I can see it tries to reach the endpoint (as it mentions its class as not being able to be adapted), I can see default mappings are registered, as the other endpoint works and responds.Code:@Endpoint public class JDomTestEndpoint { // commeted as not using PayloadRoootQName //@PayloadRoot(localPart = "myRequest", namespace = "http://www.example.org/my") @ResponsePayload public Source getPropertyMyResponse(@RequestPayload Element myRequest) { Namespace ns = Namespace.getNamespace("http://www.example.org/my"); return new StringSource( "<myResponse xmlns='http://www.example.org/my'>" + "<objectValue>" + "Received " + myRequest.getChildText("testQuery", ns) + "</objectValue>" + "</myResponse>"); } }
Is there any possibility that registering my endpoint mapping would prevent from registering or wiring the DefaultMethodEndpointAdapter, or the JDomPayloadMethodProcessor ?
How come there is a symmetry break ?
I am on Spring-WS 2.0.2 + Spring 3.0.5 on Tomcat 7.0.11.
Need some suggestions desperately
Cheers,
Chris



Reply With Quote