2015-03-13 72 views
3

我試圖從URL生成WSDL,但它/我無法做到。我的pom.xml文件配置是這樣的:Spring Maven - 無法生成WSDL

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
<modelVersion>4.0.0</modelVersion> 

<groupId>org.springframework</groupId> 
<artifactId>gs-consuming-web-service</artifactId> 
<version>0.1.0</version> 

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.2.2.RELEASE</version> 
</parent> 

<properties> 
    <!-- use UTF-8 for everything --> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
</properties> 

<dependencies> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.ws</groupId> 
     <artifactId>spring-ws-core</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>com.sun.xml.bind</groupId> 
     <artifactId>jaxb-xjc</artifactId> 
     <version>2.2.5</version> 
    </dependency> 
    <dependency> 
     <groupId>org.jvnet.jaxb2.maven2</groupId> 
     <artifactId>maven-jaxb2-plugin</artifactId> 
     <version>0.12.3</version> 
    </dependency> 
</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
     </plugin> 
     <!-- tag::wsdl[] --> 
     <plugin> 
      <groupId>org.jvnet.jaxb2.maven2</groupId> 
      <artifactId>maven-jaxb2-plugin</artifactId> 
      <version>0.12.3</version> 
      <executions> 
       <execution> 
        <goals> 
         <goal>generate</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <schemaLanguage>WSDL</schemaLanguage> 
       <generatePackage>hello.wsdl</generatePackage> 
       <schemas> 
        <schema> 
         <url>http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl</url> 
        </schema> 
       </schemas> 
      </configuration> 
     </plugin> 
     <!-- end::wsdl[] --> 
    </plugins> 
    <pluginManagement> 
     <plugins> 
      <!--This plugin's configuration is used to store Eclipse m2e settings 
       only. It has no influence on the Maven build itself. --> 
      <plugin> 
       <groupId>org.eclipse.m2e</groupId> 
       <artifactId>lifecycle-mapping</artifactId> 
       <version>1.0.0</version> 
       <configuration> 
        <lifecycleMappingMetadata> 
         <pluginExecutions> 
          <pluginExecution> 
           <pluginExecutionFilter> 
            <groupId> 
             org.jvnet.jaxb2.maven2 
            </groupId> 
            <artifactId> 
             maven-jaxb2-plugin 
            </artifactId> 
            <versionRange> 
             [0.8.0,) 
            </versionRange> 
            <goals> 
             <goal>generate</goal> 
            </goals> 
           </pluginExecutionFilter> 
           <action> 
            <ignore></ignore> 
           </action> 
          </pluginExecution> 
         </pluginExecutions> 
        </lifecycleMappingMetadata> 
       </configuration> 
      </plugin> 
     </plugins> 
    </pluginManagement> 
</build> 

<repositories> 
    <repository> 
     <id>spring-releases</id> 
     <name>Spring Releases</name> 
     <url>https://repo.spring.io/libs-release</url> 
    </repository> 
</repositories> 
<pluginRepositories> 
    <pluginRepository> 
     <id>spring-releases</id> 
     <url>https://repo.spring.io/libs-release</url> 
    </pluginRepository> 
</pluginRepositories> 

</project> 

我解決了所有在pom.xml文件發生和JAXB2是公認的錯誤。當我運行「maven generate-sources」時,我得到以下輸出:

[警告] URI [wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl]似乎代表絕對的HTTP或HTTPS URL。獲取最後修改時間戳只有在URL可訪問且服務器正確返回[Last-Modified]標頭時纔有可能。這種方法不可靠,可能會失敗。在這種情況下,最後修改時間戳將被假定爲未知。 [錯誤]無法從HTTP URL連接中檢索URI [wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl]的上次修改時間戳。 [Last-Modified]標頭可能設置不正確。 [警告]最後修改URI [http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl]未知。

但我不知道如何解決這個問題。同樣的SOAP服務在這一Spring Guide

使用(我不得不更改URL中的錯誤消息,因爲我不能發佈超過2個鏈接)

+0

請讓我們知道您看到的其他*錯誤消息。這不會阻止我的項目中建立的來源。 – Steve 2015-03-13 08:44:52

+0

我沒有看到任何其他錯誤,這是唯一的一個,他總是返回構建succesfull。我確實找到了使用wsimport的工作。 – 2015-03-13 08:48:36

回答

1

沒有與m2eclipse的一個問題。最好的方法是在命令行中使用maven或使用其他IDEA。