admin管理员组文章数量:1026989
I try to learn SpringBoot SOAP web-service implementation and don't understand why configuration methods not called. The configuration bean looks like this:
package hu.infokristaly.fileservice;
import .springframework.boot.web.servlet.ServletRegistrationBean;
import .springframework.context.ApplicationContext;
import .springframework.context.annotation.Bean;
import .springframework.context.annotation.Configuration;
import .springframework.core.io.ClassPathResource;
import .springframework.ws.config.annotation.EnableWs;
import .springframework.ws.config.annotation.WsConfigurerAdapter;
import .springframework.ws.transport.http.MessageDispatcherServlet;
import .springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
import .springframework.xml.xsd.SimpleXsdSchema;
import .springframework.xml.xsd.XsdSchema;
@Configuration
@EnableWs
public class SOAPWebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/ws/*");
}
@Bean(name = "FileUploadServiceWsdl")
public DefaultWsdl11Definition calculatorServiceDefinition(XsdSchema calculatorServiceSchema) {
DefaultWsdl11Definition wsdlDefinition = new DefaultWsdl11Definition();
wsdlDefinition.setPortTypeName("FileUploadServicePort");
wsdlDefinition.setLocationUri("/ws/fileuplaod-service");
wsdlDefinition.setTargetNamespace(";);
wsdlDefinition.setSchema(fileUplaodServiceSchema());
return wsdlDefinition;
}
@Bean
public XsdSchema fileUplaodServiceSchema() {
return new SimpleXsdSchema(new ClassPathResource("fileupload.xsd"));
}
}
In other project the messageDispatcherServlet / fileUplaodServiceSchema / calculatorServiceDefinition methods called on startup.
Here is my Github repo
Please help me find solution. It's maybe just some misspell but I can't see the problem. Thanks for all suggestions!
I try to learn SpringBoot SOAP web-service implementation and don't understand why configuration methods not called. The configuration bean looks like this:
package hu.infokristaly.fileservice;
import .springframework.boot.web.servlet.ServletRegistrationBean;
import .springframework.context.ApplicationContext;
import .springframework.context.annotation.Bean;
import .springframework.context.annotation.Configuration;
import .springframework.core.io.ClassPathResource;
import .springframework.ws.config.annotation.EnableWs;
import .springframework.ws.config.annotation.WsConfigurerAdapter;
import .springframework.ws.transport.http.MessageDispatcherServlet;
import .springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
import .springframework.xml.xsd.SimpleXsdSchema;
import .springframework.xml.xsd.XsdSchema;
@Configuration
@EnableWs
public class SOAPWebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/ws/*");
}
@Bean(name = "FileUploadServiceWsdl")
public DefaultWsdl11Definition calculatorServiceDefinition(XsdSchema calculatorServiceSchema) {
DefaultWsdl11Definition wsdlDefinition = new DefaultWsdl11Definition();
wsdlDefinition.setPortTypeName("FileUploadServicePort");
wsdlDefinition.setLocationUri("/ws/fileuplaod-service");
wsdlDefinition.setTargetNamespace("http://infokristaly.hu/fileuplaod");
wsdlDefinition.setSchema(fileUplaodServiceSchema());
return wsdlDefinition;
}
@Bean
public XsdSchema fileUplaodServiceSchema() {
return new SimpleXsdSchema(new ClassPathResource("fileupload.xsd"));
}
}
In other project the messageDispatcherServlet / fileUplaodServiceSchema / calculatorServiceDefinition methods called on startup.
Here is my Github repo
Please help me find solution. It's maybe just some misspell but I can't see the problem. Thanks for all suggestions!
Share Improve this question asked Nov 16, 2024 at 10:57 Papp ZoltánPapp Zoltán 2091 silver badge8 bronze badges 1- I moved the FileUploadEndpoint / SOAPWebServiceConfig / FileUploadImpl to the same directory as ForrasUploadSoapServerApplication and configuration loaded. How funny. – Papp Zoltán Commented Nov 16, 2024 at 12:02
1 Answer
Reset to default 0If your configuratoins are in different packages, use @ComponentScan on application like this:
@SpringBootApplication
@ComponentScan(basePackages = {"hu.infokristaly"})
public class ForrasUploadSoapServerApplication {
private static ApplicationContext applicationContext;
public static void main(String[] args) {
SpringApplication.run(ForrasUploadSoapServerApplication.class, args);
}
}
I try to learn SpringBoot SOAP web-service implementation and don't understand why configuration methods not called. The configuration bean looks like this:
package hu.infokristaly.fileservice;
import .springframework.boot.web.servlet.ServletRegistrationBean;
import .springframework.context.ApplicationContext;
import .springframework.context.annotation.Bean;
import .springframework.context.annotation.Configuration;
import .springframework.core.io.ClassPathResource;
import .springframework.ws.config.annotation.EnableWs;
import .springframework.ws.config.annotation.WsConfigurerAdapter;
import .springframework.ws.transport.http.MessageDispatcherServlet;
import .springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
import .springframework.xml.xsd.SimpleXsdSchema;
import .springframework.xml.xsd.XsdSchema;
@Configuration
@EnableWs
public class SOAPWebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/ws/*");
}
@Bean(name = "FileUploadServiceWsdl")
public DefaultWsdl11Definition calculatorServiceDefinition(XsdSchema calculatorServiceSchema) {
DefaultWsdl11Definition wsdlDefinition = new DefaultWsdl11Definition();
wsdlDefinition.setPortTypeName("FileUploadServicePort");
wsdlDefinition.setLocationUri("/ws/fileuplaod-service");
wsdlDefinition.setTargetNamespace(";);
wsdlDefinition.setSchema(fileUplaodServiceSchema());
return wsdlDefinition;
}
@Bean
public XsdSchema fileUplaodServiceSchema() {
return new SimpleXsdSchema(new ClassPathResource("fileupload.xsd"));
}
}
In other project the messageDispatcherServlet / fileUplaodServiceSchema / calculatorServiceDefinition methods called on startup.
Here is my Github repo
Please help me find solution. It's maybe just some misspell but I can't see the problem. Thanks for all suggestions!
I try to learn SpringBoot SOAP web-service implementation and don't understand why configuration methods not called. The configuration bean looks like this:
package hu.infokristaly.fileservice;
import .springframework.boot.web.servlet.ServletRegistrationBean;
import .springframework.context.ApplicationContext;
import .springframework.context.annotation.Bean;
import .springframework.context.annotation.Configuration;
import .springframework.core.io.ClassPathResource;
import .springframework.ws.config.annotation.EnableWs;
import .springframework.ws.config.annotation.WsConfigurerAdapter;
import .springframework.ws.transport.http.MessageDispatcherServlet;
import .springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
import .springframework.xml.xsd.SimpleXsdSchema;
import .springframework.xml.xsd.XsdSchema;
@Configuration
@EnableWs
public class SOAPWebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/ws/*");
}
@Bean(name = "FileUploadServiceWsdl")
public DefaultWsdl11Definition calculatorServiceDefinition(XsdSchema calculatorServiceSchema) {
DefaultWsdl11Definition wsdlDefinition = new DefaultWsdl11Definition();
wsdlDefinition.setPortTypeName("FileUploadServicePort");
wsdlDefinition.setLocationUri("/ws/fileuplaod-service");
wsdlDefinition.setTargetNamespace("http://infokristaly.hu/fileuplaod");
wsdlDefinition.setSchema(fileUplaodServiceSchema());
return wsdlDefinition;
}
@Bean
public XsdSchema fileUplaodServiceSchema() {
return new SimpleXsdSchema(new ClassPathResource("fileupload.xsd"));
}
}
In other project the messageDispatcherServlet / fileUplaodServiceSchema / calculatorServiceDefinition methods called on startup.
Here is my Github repo
Please help me find solution. It's maybe just some misspell but I can't see the problem. Thanks for all suggestions!
Share Improve this question asked Nov 16, 2024 at 10:57 Papp ZoltánPapp Zoltán 2091 silver badge8 bronze badges 1- I moved the FileUploadEndpoint / SOAPWebServiceConfig / FileUploadImpl to the same directory as ForrasUploadSoapServerApplication and configuration loaded. How funny. – Papp Zoltán Commented Nov 16, 2024 at 12:02
1 Answer
Reset to default 0If your configuratoins are in different packages, use @ComponentScan on application like this:
@SpringBootApplication
@ComponentScan(basePackages = {"hu.infokristaly"})
public class ForrasUploadSoapServerApplication {
private static ApplicationContext applicationContext;
public static void main(String[] args) {
SpringApplication.run(ForrasUploadSoapServerApplication.class, args);
}
}
本文标签: spring bootSpringBoot SOAP configuration not calledStack Overflow
版权声明:本文标题:spring boot - SpringBoot SOAP configuration not called - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745660184a2161840.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论