2021-03-04 14:36:51.754警告3792---[nio-8080-exec-1]o.s.ws.server.endpointnotfound:找不到[saajsoapmessage请求]的终结点Map
我不知道我该怎么做才能使它正确
终结点
@Slf4j
@Endpoint
public class ZFrontEndpoint {
private static final String NAMESPACE_URI = "http://tempuri.org/";
private static final String REQUEST = "Request";
@PayloadRoot(namespace = NAMESPACE_URI, localPart = REQUEST)
public @ResponsePayload SyncResponse syncResponse(@RequestPayload Request request) {
log.info("request received");
SyncResponse response = new SyncResponse();
response.setAny("SUCCESS");
return response;
}
}
服务配置
@EnableWs
@Configuration
public class WebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean<MessageDispatcherServlet> messageDispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
servlet.setMessageFactoryBeanName("saajSoapMessageFactory");
return new ServletRegistrationBean<>(servlet, "/z-front/*");
}
@Bean(name = "zFront")
public Wsdl11Definition wsdl11Definition() {
SimpleWsdl11Definition simpleWsdl11Definition = new SimpleWsdl11Definition();
simpleWsdl11Definition.setWsdl(new ClassPathResource("ZFront.wsdl"));
return simpleWsdl11Definition;
}
@Bean
public SaajSoapMessageFactory saajSoapMessageFactory() {
SaajSoapMessageFactory saajSoapMessageFactory = new SaajSoapMessageFactory();
saajSoapMessageFactory.setSoapVersion(SoapVersion.SOAP_12);
saajSoapMessageFactory.setLangAttributeOnSoap11FaultString(true);
saajSoapMessageFactory.afterPropertiesSet();
return saajSoapMessageFactory;
}
}
暂无答案!
目前还没有任何答案,快来回答吧!