2015-08-03 4 views
1

Служба SpringWS не отвечает на запросы через SOAP UI?Служба SpringWS не отвечает на любые запросы через SOAP UI

Collegues, я начинаю весной, и мне нужна помощь. Я создал веб-службу и могу получить описание wsdl в интерфейсе SOAP, но проблема в том, что служба не отвечает на запросы. Это мой веб-srvice конфигурации:

package com.mayacomp.app; 

import org.springframework.boot.context.embedded.ServletRegistrationBean; 
import org.springframework.context.ApplicationContext; 
import org.springframework.context.annotation.Bean; 
import org.springframework.context.annotation.Configuration; 
import org.springframework.core.io.ClassPathResource; 
import org.springframework.ws.config.annotation.EnableWs; 
import org.springframework.ws.config.annotation.WsConfigurerAdapter; 
import org.springframework.ws.transport.http.MessageDispatcherServlet; 
import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition; 
import org.springframework.xml.xsd.SimpleXsdSchema; 
import org.springframework.xml.xsd.XsdSchema; 

@EnableWs 
@Configuration 
public class WebServiceConfig extends WsConfigurerAdapter { 

    @Bean 
    public ServletRegistrationBean dispatcherServlet(ApplicationContext applicationContext) { 
     MessageDispatcherServlet servlet = new MessageDispatcherServlet(); 
     servlet.setApplicationContext(applicationContext); 
     return new ServletRegistrationBean(servlet, "/services/*"); 
    } 

    @Bean(name = "APPService") 
    public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema APPServiceSchema) { 
     DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition(); 
     wsdl11Definition.setPortTypeName("ApplicationWS"); 
     wsdl11Definition.setLocationUri("/APPService/"); 
     wsdl11Definition.setTargetNamespace("http://mayaapp.com/application"); 
     wsdl11Definition.setSchema(APPServiceSchema); 
     return wsdl11Definition; 
    } 



    @Bean 
    public XsdSchema APPServiceSchema() { 
     return new SimpleXsdSchema(new ClassPathResource("META-INF/schemas/application.xsd")); 
    } 

} 

Моя конечная точка класса:

package com.mayacomp.endpoint; 
import java.util.logging.Logger; 

import org.springframework.beans.factory.annotation.Autowired; 
import org.springframework.ws.server.endpoint.annotation.Endpoint; 
import org.springframework.ws.server.endpoint.annotation.PayloadRoot; 
import org.springframework.ws.server.endpoint.annotation.RequestPayload; 
import org.springframework.ws.server.endpoint.annotation.ResponsePayload; 

import com.mayacomp.app.InternalHistRequest; 
import com.mayacomp.app.InternalHistResponse; 
import com.mayacomp.app.InternalCreditHistFlagsType; 
import com.mayacomp.app.InternalCreditHistIndicatorsType; 
import com.mayacomp.app.ResponseHeaderType; 
import com.mayacomp.service.APPService; 



@Endpoint 
public class WsEndpoint { 

    private static final Logger LOG = Logger.getLogger(WsEndpoint.class.getName()); 

    private static final String TARGET_NAMESPACE = "http://mayaapp.com/application"; 



    @Autowired 
    public APPService APPService_i; 


    @PayloadRoot(localPart = "InternalHistRequest", namespace = TARGET_NAMESPACE) 

    public @ResponsePayload InternalHistResponse getInternalCredHist(@RequestPayload InternalHistRequest request) { 
      LOG.info("Test"); 



      InternalHistResponse _return = new InternalHistResponse(); 


      _return.setClientID(new java.math.BigInteger("42823928316076042522945935239155481381")); 


      try 
      { 

      ResponseHeaderType _returnResponseHeader = new ResponseHeaderType(); 
      _returnResponseHeader.setRequestUid("RequestUid-207722529"); 
      _returnResponseHeader.setRequestTimestamp(javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar("2015-05-06T10:28:37.616+03:00")); 
      _returnResponseHeader.setResponseUid("ResponseUid2066314058"); 
      _returnResponseHeader.setResponseTimestamp(javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar("2015-05-06T10:28:37.616+03:00")); 
      _returnResponseHeader.setResponseCode(1883325675); 
      _returnResponseHeader.setResponseDescription("ResponseDescription-1084371447"); 
      _return.setResponseHeader(_returnResponseHeader); 

      /* call Spring injected service implementation to retrieve credit history data */ 
      InternalCreditHistFlagsType _returnInternalCreditHistFlags = APPService_i.getInternalCreditHistFlagsType(request); 
      _return.setInternalCreditHistFlags(_returnInternalCreditHistFlags); 
      /* call Spring injected service implementation to retrieve credit history data */ 
      InternalCreditHistIndicatorsType _returnInternalCreditHisIndicators = APPService_i.getInternalCredHist(request); 
      _return.setInternalCreditHisIndicators(_returnInternalCreditHisIndicators); 

      return _return; 

      } 

     catch (java.lang.Exception ex) { 
     ex.printStackTrace(); 
     throw new RuntimeException(ex); 
    } 



    } 

    public void setAPPService(APPService APPService_p) 
    { 
     this.APPService_i = APPService_p; 
    } 




} 

Мой ПОМ файл (может быть что-то с зависимостями)

http://maven.apache.org/ Maven-v4_0_0.xsd "> 4.0.0 com.mayacomp.pco APPService

<version>0.0.1-SNAPSHOT</version> 
<name>APPService Spring-WS Application</name> 
<url>http://www.springframework.org/spring-ws</url> 

<inceptionYear>2015</inceptionYear> 
<packaging>jar</packaging> 




<build> 
     <finalName>PCOService</finalName> 
     <plugins> 
      <plugin> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>1.8</source> 
        <target>1.8</target> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>tomcat-maven-plugin</artifactId> 
       <version>1.1</version> 
      </plugin> 


      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>jaxb2-maven-plugin</artifactId> 
       <version>1.4</version> 
       <executions> 
        <execution> 
         <goals> 
          <goal>xjc</goal> 
         </goals> 
         <phase>generate-sources</phase> 
        </execution> 
       </executions> 
       <configuration> 
        <clearOutputDir>false</clearOutputDir> 
        <outputDirectory>src/main/java</outputDirectory> 
        <schemaDirectory>src/main/resources/META-INF/schemas</schemaDirectory> 
        <includeSchema>**/*.xsd</includeSchema> 
         <bindingDirectory>src/main/java/com/mayacomp/app</bindingDirectory> 
        <enableIntrospection>false</enableIntrospection> 
       </configuration> 
      </plugin> 



     </plugins> 
    </build> 
    <dependencies> 




    <dependency> 
     <groupId>wsdl4j</groupId> 
     <artifactId>wsdl4j</artifactId> 
     <version>1.6.3</version> 
    </dependency> 


    <!-- Spring dependencies --> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-core</artifactId> 
     <version>4.1.7.RELEASE</version> 
     <scope>compile</scope> 
       <exclusions> 
       <exclusion> 
        <artifactId>commons-logging</artifactId> 
        <groupId>commons-logging</groupId> 
       </exclusion> 
       </exclusions> 
    </dependency> 


     <dependency> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-starter</artifactId> 
       <version>1.2.5.RELEASE</version> 
     <exclusions> 
      <exclusion> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-starter-logging</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-log4j</artifactId> 
     <version>1.2.5.RELEASE</version> 
    </dependency> 


    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-log4j</artifactId> 
     <version>1.2.5.RELEASE</version> 
    </dependency> 



    <dependency> 
     <groupId>org.springframework.ws</groupId> 
     <artifactId>spring-ws-core</artifactId> 
     <version>2.2.1.RELEASE</version> 
    </dependency> 



    <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-ws</artifactId> 
      <version>1.2.5.RELEASE</version> 
    </dependency> 

    <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-beans</artifactId> 
      <version>4.1.7.RELEASE</version> 
    </dependency> 


    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-ws</artifactId> 
     <version>1.2.5.RELEASE</version> 
    </dependency> 


    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
     <version>4.1.7.RELEASE</version> 
    </dependency> 

     <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-expression</artifactId> 
     <version>4.1.7.RELEASE</version> 
    </dependency> 


</dependencies> 

Как я сказал, что я есть в наличии после WSDL

МВН -U весна-загрузки: запуск

через URL http://localhost:8080/services/APPService/APPService.wsdl но операции не работают. Пожалуйста помоги.

UPDATE Spring Журнал загрузки трассировки:

DEBUG: [авг-03 13:08:33,082] boot.logging.ClasspathLoggingApplicationListener - Application started with classpath: [file:/C:/Users/Maya/workspace/APPService/src/main/resources/, file:/C:/Users/Maya/workspace/APPService/target/classes/, file:/C:/Users/Maya/.m2/repository/com/fasterxml/classmate/1.0.0/classmate-1.0.0.jar, file:/C:/Users/Maya/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/boot/spring-boot-starter/1.2.5.RELEASE/spring-boot-starter-1.2.5.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/yaml/snakeyaml/1.14/snakeyaml-1.14.jar, file:/C:/Users/Maya/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-beans/4.1.7.RELEASE/spring-beans-4.1.7.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/slf4j/slf4j-api/1.7.12/slf4j-api-1.7.12.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-jms/4.1.7.RELEASE/spring-jms-4.1.7.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/ws/spring-ws-support/2.2.1.RELEASE/spring-ws-support-2.2.1.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.4.0/jackson-annotations-2.4.0.jar, file:/C:/Users/Maya/.m2/repository/org/slf4j/jul-to-slf4j/1.7.12/jul-to-slf4j-1.7.12.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.2.5.RELEASE/spring-boot-starter-web-1.2.5.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.12/jcl-over-slf4j-1.7.12.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/ws/spring-xml/2.2.1.RELEASE/spring-xml-2.2.1.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-aop/4.0.9.RELEASE/spring-aop-4.0.9.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.4.6/jackson-databind-2.4.6.jar, file:/C:/Users/Maya/.m2/repository/org/jboss/logging/jboss-logging/3.1.3.GA/jboss-logging-3.1.3.GA.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/boot/spring-boot-starter-log4j/1.2.5.RELEASE/spring-boot-starter-log4j-1.2.5.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/wsdl4j/wsdl4j/1.6.3/wsdl4j-1.6.3.jar, file:/C:/Users/Maya/.m2/repository/org/hibernate/hibernate-validator/5.1.3.Final/hibernate-validator-5.1.3.Final.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-context/4.1.7.RELEASE/spring-context-4.1.7.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/ws/spring-ws-core/2.2.1.RELEASE/spring-ws-core-2.2.1.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-webmvc/4.0.9.RELEASE/spring-webmvc-4.0.9.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.2.5.RELEASE/spring-boot-autoconfigure-1.2.5.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.0.23/tomcat-embed-websocket-8.0.23.jar, file:/C:/Users/Maya/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.23/tomcat-embed-el-8.0.23.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.2.5.RELEASE/spring-boot-starter-tomcat-1.2.5.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-web/4.1.7.RELEASE/spring-web-4.1.7.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.23/tomcat-embed-logging-juli-8.0.23.jar, file:/C:/Users/Maya/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-messaging/4.1.7.RELEASE/spring-messaging-4.1.7.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-oxm/4.0.9.RELEASE/spring-oxm-4.0.9.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/boot/spring-boot-starter-ws/1.2.5.RELEASE/spring-boot-starter-ws-1.2.5.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-tx/4.1.7.RELEASE/spring-tx-4.1.7.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/slf4j/slf4j-log4j12/1.7.12/slf4j-log4j12-1.7.12.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-expression/4.1.7.RELEASE/spring-expression-4.1.7.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/boot/spring-boot/1.2.5.RELEASE/spring-boot-1.2.5.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.4.6/jackson-core-2.4.6.jar, file:/C:/Users/Maya/.m2/repository/org/springframework/spring-core/4.1.7.RELEASE/spring-core-4.1.7.RELEASE.jar, file:/C:/Users/Maya/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.23/tomcat-embed-core-8.0.23.jar] 
DEBUG: [авг-03 13:08:33,572] springframework.boot.SpringApplication - Loading source class com.mayacomp.app.WsApplication 
DEBUG: [авг-03 13:08:33,627] context.config.ConfigFileApplicationListener - Skipped config file 'file:./config/application.xml' resource not found 
DEBUG: [авг-03 13:08:33,627] context.config.ConfigFileApplicationListener - Skipped config file 'file:./config/application.yml' resource not found 
DEBUG: [авг-03 13:08:33,628] context.config.ConfigFileApplicationListener - Skipped config file 'file:./config/application.properties' resource not found 
DEBUG: [авг-03 13:08:33,628] context.config.ConfigFileApplicationListener - Skipped config file 'file:./config/application.yaml' resource not found 
DEBUG: [авг-03 13:08:33,629] context.config.ConfigFileApplicationListener - Skipped config file 'file:./application.xml' resource not found 
DEBUG: [авг-03 13:08:33,629] context.config.ConfigFileApplicationListener - Skipped config file 'file:./application.yml' resource not found 
DEBUG: [авг-03 13:08:33,630] context.config.ConfigFileApplicationListener - Skipped config file 'file:./application.properties' resource not found 
DEBUG: [авг-03 13:08:33,630] context.config.ConfigFileApplicationListener - Skipped config file 'file:./application.yaml' resource not found 
DEBUG: [авг-03 13:08:33,631] context.config.ConfigFileApplicationListener - Skipped config file 'classpath:/config/application.xml' resource not found 
DEBUG: [авг-03 13:08:33,631] context.config.ConfigFileApplicationListener - Skipped config file 'classpath:/config/application.yml' resource not found 
DEBUG: [авг-03 13:08:33,632] context.config.ConfigFileApplicationListener - Skipped config file 'classpath:/config/application.properties' resource not found 
DEBUG: [авг-03 13:08:33,632] context.config.ConfigFileApplicationListener - Skipped config file 'classpath:/config/application.yaml' resource not found 
DEBUG: [авг-03 13:08:33,633] context.config.ConfigFileApplicationListener - Skipped config file 'classpath:/application.xml' resource not found 
DEBUG: [авг-03 13:08:33,633] context.config.ConfigFileApplicationListener - Skipped config file 'classpath:/application.yml' resource not found 
DEBUG: [авг-03 13:08:33,634] context.config.ConfigFileApplicationListener - Skipped config file 'classpath:/application.properties' resource not found 
DEBUG: [авг-03 13:08:33,634] context.config.ConfigFileApplicationListener - Skipped config file 'classpath:/application.yaml' resource not found 
INFO : [авг-03 13:08:33,642] context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot[email protected]731b45a8: startup date [Mon Aug 03 13:08:33 MSK 2015]; root of context hierarchy 
DEBUG: [aug-03 13:08:33,649] context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Bean factory for org.springframework.boot[email protected]731b45a8: org.springframework.beans.factory.support.DefaultL[email protected]: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,wsApplication]; root of factory hierarchy 
DEBUG: [aug-03 13:08:35,233] context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [[email protected]dd6a] 
DEBUG: [aug-03 13:08:35,233] context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Using ApplicationEventMulticaster [org.[email protected]4cc2be65] 
DEBUG: [aug-03 13:08:35,658] embedded.tomcat.TomcatEmbeddedServletContainerFactory - Code archive: C:\Users\Maya\.m2\repository\org\springframework\boot\spring-boot\1.2.5.RELEASE\spring-boot-1.2.5.RELEASE.jar 
DEBUG: [aug-03 13:08:35,659] embedded.tomcat.TomcatEmbeddedServletContainerFactory - Code archive: C:\Users\Maya\.m2\repository\org\springframework\boot\spring-boot\1.2.5.RELEASE\spring-boot-1.2.5.RELEASE.jar 
DEBUG: [aug-03 13:08:35,660] embedded.tomcat.TomcatEmbeddedServletContainerFactory - Document root: C:\Users\Maya\workspace\APPService\src\main\webapp 
INFO : [aug-03 13:08:35,705] embedded.tomcat.TomcatEmbeddedServletContainer - Tomcat initialized with port(s): 8080 (http) 
DEBUG: [aug-03 13:08:36,156] context.embedded.ServletContextInitializerBeans - Added existing Servlet initializer bean 'dispatcherServlet'; order=2147483647, resource=class path resource [com/mayacomp/app/WebServiceConfig.class] 
DEBUG: [aug-03 13:08:36,271] context.embedded.ServletContextInitializerBeans - Created Filter initializer for bean 'characterEncodingFilter'; order=-2147483648, resource=class path resource [org/springframework/boot/autoconfigure/web/HttpEncodingAutoConfiguration.class] 
DEBUG: [aug-03 13:08:36,272] context.embedded.ServletContextInitializerBeans - Created Filter initializer for bean 'hiddenHttpMethodFilter'; order=-2147483638, resource=class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.class] 
DEBUG: [aug-03 13:08:36,827] context.embedded.ServletContextInitializerBeans - Created EventListener initializer for bean 'requestContextListener'; order=2147483647, resource=class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class] 
INFO : [aug-03 13:08:36,830] context.embedded.ServletRegistrationBean - Mapping servlet: 'messageDispatcherServlet' to [/services/*] 
INFO : [aug-03 13:08:36,837] context.embedded.FilterRegistrationBean - Mapping filter: 'characterEncodingFilter' to: [/*] 
INFO : [aug-03 13:08:36,838] context.embedded.FilterRegistrationBean - Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 
DEBUG: [aug-03 13:08:36,987] context.web.OrderedHiddenHttpMethodFilter - Initializing filter 'hiddenHttpMethodFilter' 
DEBUG: [aug-03 13:08:36,989] context.web.OrderedHiddenHttpMethodFilter - Filter 'hiddenHttpMethodFilter' configured successfully 
DEBUG: [aug-03 13:08:36,990] context.web.OrderedCharacterEncodingFilter - Initializing filter 'characterEncodingFilter' 
DEBUG: [aug-03 13:08:36,990] context.web.OrderedCharacterEncodingFilter - Filter 'characterEncodingFilter' configured successfully 
DEBUG: [aug-03 13:08:37,676] context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [[email protected]79e98a] 
DEBUG: [aug-03 13:08:37,682] autoconfigure.logging.AutoConfigurationReportLoggingInitializer - 


========================= 
AUTO-CONFIGURATION REPORT 
========================= 


Positive matches: 
----------------- 
bla bla 
Negative matches: 

bla bla 

INFO : [aug-03 13:08:37,877] embedded.tomcat.TomcatEmbeddedServletContainer - Tomcat started on port(s): 8080 (http) 
+1

Ваш журнал регистрации ошибок/трассировки полезно, не могли бы вы опубликовать? –

+0

@ s.kwiotek, извините. Я добавил. Но это только весенний журнал загрузки. Надеюсь, поможет. – May12

+1

Я не вижу конфигурацию плагина для maven для создания классов Java из файла XSD. –

ответ

1

Пожалуйста, удалите двойные записи в вашем ПОМ:

  • весна-загрузки-стартер-log4j
  • весна-загрузки starter- ws

В вашей сети ServiceConfig, пожалуйста, добавьте:

servlet.setTransformWsdlLocations(true); 

Вы должны сгенерировать классы домена на основе XML-схемы автоматически во время сборки. Поэтому, пожалуйста, добавьте в ваш POM и изменять schemaDir и OutputDir для ваших требований:

<plugin> 
<groupId>org.codehaus.mojo</groupId> 
<artifactId>jaxb2-maven-plugin</artifactId> 
<version>1.6</version> 
<executions> 
    <execution> 
     <id>xjc</id> 
     <goals> 
      <goal>xjc</goal> 
     </goals> 
    </execution> 
</executions> 
<configuration> 
    <schemaDirectory>${project.basedir}/src/main/resources/</schemaDirectory> 
    <outputDirectory>${project.basedir}/src/main/java</outputDirectory> 
    <clearOutputDir>false</clearOutputDir> 
</configuration> 

я вижу, что ваше главное приложение находится в пакете com.mayacomp.app и вы аннотированный этот класс с @SpringBootApplication. Поэтому важно, чтобы ваши компоненты WS находились под пакетом com.mayacomp.app, иначе поиск компонентов не смог найти их. Имейте в виду, что ваше целевое пространство имен идентично в зависимых компонентах и ​​в элементе SoapEnvelop Xml-Request. Вы можете дать ему попробовать на ваших конечных точек/услуг и с тестового файла, как test.xml, например, с загнутым:

curl --header "content-type: text/xml" -d @test.xml http://localhost:8080/services/ 
+0

s.kwiotek, еще раз спасибо. Еще один вопрос: я хочу добавить еще одну операцию (например, getWeather) в WebSiervice. Я добавляю метод getWeather в WsEndpoint.java, и у меня есть proplem: ответы службы me {"timestamp": 1443709281706, "status": 405, "error": "Method Not Allowed", "exception": "org.springframework.web .HttpRequestMethodNotSupportedException "," message ":" Метод запроса "POST" не поддерживается "," путь ":"/AppService/"}. Вы можете помочь? – May12

+0

Не могли бы вы разместить свой WSDL-файл. Я бы посмотрел. –

+0

s.kwiotek, я решил проблему. Еще раз спасибо за ваш пример) – May12

 Смежные вопросы

  • Нет связанных вопросов^_^