Состояние Spring-ws SOAP ": 404," ошибка ":" Не найдено "," сообщение ":" Нет доступных сообщений "," путь " - PullRequest
0 голосов
/ 01 ноября 2018

Я следовал весеннему руководству по сервисам SOAP. Я работаю с пружинной загрузкой

Я создал банку. Я исполняю

java -jar target/inventorySpringWar2.jar

Приложение правильно инициализируется. Я проверяю сервис с curl

curl --header "content-type: text/xml" -d @catalogrequest.xml http://localhost:8080/ws

Я получаю сообщение

{"timestamp":"2018-11-01T19:19:53.403+0000","status":404,"error":"Not Found","message":"No message available","path":"/ws"}

Это класс EndPoint

@Endpoint
public class InventoryEndPoint {
    private static final String NAMESPACE_URI = "http://com.uciext.ws.hw5";
    private InventoryRepository  inventoryRepository;
    private InventoryManagerImpl manager;


    @Autowired
    public InventoryEndPoint(InventoryRepository inventoryRespository) {
        this.inventoryRepository = inventoryRepository;
        manager = new InventoryManagerImpl();

    }
    @PayloadRoot(namespace = NAMESPACE_URI, localPart = "catalog")
    @ResponsePayload
    public CatalogResponse getCatalog() {

Это класс WebServiceConfig

@EnableWs
@Configuration
public class WebServiceConfig  extends WsConfigurerAdapter{


        public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
            MessageDispatcherServlet servlet = new MessageDispatcherServlet();
            servlet.setApplicationContext(applicationContext);
            servlet.setTransformWsdlLocations(true);
            ServletRegistrationBean  bean  = new ServletRegistrationBean();

            return new ServletRegistrationBean(servlet, "/ws/*");


        }

        @Bean(name = "catalog")
        public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema countriesSchema) {
            DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
            wsdl11Definition.setPortTypeName("CatalogPort");
            wsdl11Definition.setLocationUri("/ws");
            wsdl11Definition.setTargetNamespace("http://com.uciext.ws.hw5");
            wsdl11Definition.setSchema(countriesSchema);
            return wsdl11Definition;
        }

        @Bean
        public XsdSchema countriesSchema() {
            return new SimpleXsdSchema(new ClassPathResource("catalog.xsd"));
        }

}

catalog.xsd имеет targetNamespace

targetNamespace="http://com.uciext.ws.hw5" 

Как мне настроить эти классы?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...