Я борюсь с Spring -WS с примером JMS. Я установил проводку Spring -WS и JMS в соответствии с рекомендациями Spring. Но я продолжал получать следующую ошибку. Я не знаю, как обойти эту проблему, любая помощь будет высоко оценена:
[org.springframework.ws.soap.server.endpoint.SoapFaultAnnotationExceptionResolver] -
Resolving exception from endpoint
[[email protected]c8b0b1]:
java.lang.IllegalStateException: No adapter for endpoint
[[email protected]c8b0b1]:
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
[[email protected]c8b0b1]:
java.lang.IllegalStateException: No adapter for endpoint [[email protected]c8b0b1]:
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 [[email protected]c8b0b1]:
Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?
Моя проводка веб-службы
<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>
Может кто-нибудь помочь?