没有端点的适配器;您的终端节点是否使用@Endpoint进行批注,或者它是否实现了受支持的接口,如 MessageHandler 或 PayloadEndpoint?
我正在为带有JMS示例的Spring-WS而苦苦挣扎。我根据Spring建议设置Spring-WS和JMS布线。但我一直得到以下错误。我不知道如何绕过这个问题,任何帮助将不胜感激:
[org.springframework.ws.soap.server.endpoint.SoapFaultAnnotationExceptionResolver] -
Resolving exception from endpoint
[org.springframework.ws.samples.mtom.ws.ImageRepositoryEndpoint@1c8b0b1]:
java.lang.IllegalStateException: No adapter for endpoint
[org.springframework.ws.samples.mtom.ws.ImageRepositoryEndpoint@1c8b0b1]:
Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?
[org.springframework.ws.soap.server.endpoint.SimpleSoapExceptionResolver] - Resolving exception from endpoint
[org.springframework.ws.samples.mtom.ws.ImageRepositoryEndpoint@1c8b0b1]:
java.lang.IllegalStateException: No adapter for endpoint [org.springframework.ws.samples.mtom.ws.ImageRepositoryEndpoint@1c8b0b1]:
Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?
[org.springframework.ws.soap.server.SoapMessageDispatcher] -
Endpoint invocation resulted in exception - responding with Fault
java.lang.IllegalStateException: No adapter for endpoint [org.springframework.ws.samples.mtom.ws.ImageRepositoryEndpoint@1c8b0b1]:
Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?
我的 Web 服务连接是
<bean id="imageRepository"
class="org.springframework.ws.samples.mtom.service.StubImageRepository" />
<!-- JMS WIRING TO WS START -->
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" />
<bean id="messageDispatcher"
class="org.springframework.ws.soap.server.SoapMessageDispatcher">
<property name="endpointMappings">
<bean
class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping">
<property name="defaultEndpoint">
<bean
class="org.springframework.ws.samples.mtom.ws.ImageRepositoryEndpoint">
<constructor-arg ref="imageRepository" />
</bean>
</property>
</bean>
</property>
</bean>
<bean
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory" />
<property name="destinationName" value="WS.JMS.EXAMPLE.V1.IMAGE.REPO.REQUEST" />
<property name="messageListener">
<bean
class="org.springframework.ws.transport.jms.WebServiceMessageListener">
<property name="messageFactory" ref="messageFactory" />
<property name="messageReceiver" ref="messageDispatcher" />
</bean>
</property>
</bean>
我的终点代码是
@PayloadRoot(localPart = "StoreImageRequest", namespace = "http://www.springframework.org/spring-ws/samples/mtom")
@ResponsePayload
public String store(@RequestPayload JAXBElement<Image> requestElement) throws IOException {
Image request = requestElement.getValue();
return imageRepository.storeImage(request.getName());
}
我的架构是
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.springframework.org/spring-ws/samples/mtom"
xmlns:tns="http://www.springframework.org/spring-ws/samples/mtom"
xmlns:xmime="http://www.w3.org/2005/05/xmlmime" elementFormDefault="qualified">
<element name="StoreImageRequest" type="tns:Image"/>
<element name="LoadImageRequest" type="string"/>
<element name="LoadImageResponse" type="tns:Image"/>
<complexType name="Image">
<sequence>
<element name="name" type="string"/>
</sequence>
</complexType>
</schema>
我的客户请求是
<ns2:StoreImageRequest xmlns:ns2="http://www.springframework.org/spring-ws/samples/mtom"><ns2:name>spring-ws-logo.png</ns2:name></ns2:StoreImageRequest>
有人可以帮忙吗?