2012-02-16 161 views
0

我正在嘗試通過使用eclipse來生成項目來使用wsdl來創建SOA服務。所以我在eclipse中選擇了New,然後選擇了Service(來自wsdl),並且我打開了一個嚮導,因此在該向導中我選擇了現有的wsdl作爲選項。我使用該向導生成兩個項目 - 一宗外地傳入我的WSDL是TrackIntlService和另一種是TrackIntlServiceImpl但沒有兩個項目中包含的任何類文件,我總是得到錯誤的Codegen failed with the following exception。 有沒有特定的方法來做到這一點?使用WSDL生成項目

這是我下面的WSDL文件 -

<?xml version="1.0" encoding="UTF-8"?> 
<definitions name="TrackIntlService" targetNamespace="http://www.host.com/CommercialPlace/marketing/v1/services" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tns="http://www.host.com/CommercialPlace/marketing/v1/services" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <types> 
     <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.host.com/CommercialPlace/marketing/v1/services"> 
      <xs:simpleType name="AckValue"> 
       <xs:annotation> 
        <xs:documentation> 
         Indicates whether the error is a severe error 
         (causing the request to fail) or an 
         informational error (a warning) 
         that should be 
         communicated to the user. 
        </xs:documentation> 
        <xs:appinfo> 
         <typeLibrarySource library="CommercialPlaceService" namespace="http://www.host.com/CommercialPlace/services"/> 
        </xs:appinfo> 
       </xs:annotation> 
       <xs:restriction base="xs:string"> 
        <xs:enumeration value="Success"> 
         <xs:annotation> 
          <xs:documentation> 
           The request was processed successfully, 
           but 
           something occurred that may affect 
           your application or the user. 
          </xs:documentation> 
         </xs:annotation> 
        </xs:enumeration> 
        <xs:enumeration value="Failure"> 
         <xs:annotation> 
          <xs:documentation> 
           The request that triggered the error was 
           not 
           processed successfully. When a 
           serious application-level error 
           occurs, 
           the error is returned instead of the 
           business data. 
          </xs:documentation> 
         </xs:annotation> 
        </xs:enumeration> 
        <xs:enumeration value="Warning"> 
         <xs:annotation> 
          <xs:documentation> 
           The request that triggered the error was 
           processed successfully but with some 
           warnings. 
          </xs:documentation> 
         </xs:annotation> 
        </xs:enumeration> 
        <xs:enumeration value="PartialFailure"> 
         <xs:annotation> 
          <xs:documentation> 
           The request that triggered the error was 
           processed successfully but with some 
           warnings. 
          </xs:documentation> 
         </xs:annotation> 
        </xs:enumeration> 
       </xs:restriction> 
      </xs:simpleType> 

      <xs:complexType abstract="true" name="BaseRequest"> 
       <xs:annotation> 
        <xs:documentation> 
         This is the base class for request container for 
         all service operations. 
        </xs:documentation> 
        <xs:appinfo> 
         <typeLibrarySource library="CommercialPlaceService" namespace="http://www.host.com/CommercialPlace/services"/> 
        </xs:appinfo> 
       </xs:annotation> 
       <xs:sequence> 
        <xs:element maxOccurs="unbounded" minOccurs="0" name="extension" type="tns:ExtensionType"/> 
       </xs:sequence> 
      </xs:complexType> 
      <xs:complexType abstract="true" name="BaseResponse"> 
       <xs:annotation> 
        <xs:documentation> 
         Base response container for all service 
         operations. Contains error information 
         associated with the request. 
        </xs:documentation> 
        <xs:appinfo> 
         <typeLibrarySource library="CommercialPlaceService" namespace="http://www.host.com/CommercialPlace/services"/> 
        </xs:appinfo> 
       </xs:annotation> 
       <xs:sequence> 
        <xs:element name="ack" type="tns:AckValue"> 
         <xs:annotation> 
          <xs:documentation/> 
          <xs:appinfo> 
           <CallInfo> 
            <AllCalls/> 
            <Returned>Always</Returned> 
           </CallInfo> 
          </xs:appinfo> 
         </xs:annotation> 
        </xs:element> 
        <xs:element minOccurs="0" name="errorMessage" type="tns:ErrorMessage"> 
         <xs:annotation> 
          <xs:documentation> 
           Information for an error or warning that 
           occurred when host processed the 
           request. 
          </xs:documentation> 
          <xs:appinfo> 
           <CallInfo> 
            <AllCalls/> 
            <Returned>Conditionally</Returned> 
           </CallInfo> 
          </xs:appinfo> 
         </xs:annotation> 
        </xs:element> 
        <xs:element minOccurs="0" name="version" type="xs:string"> 
         <xs:annotation> 
          <xs:documentation/> 
          <xs:appinfo> 
           <CallInfo> 
            <AllCalls/> 
            <Returned>Always</Returned> 
           </CallInfo> 
          </xs:appinfo> 
         </xs:annotation> 
        </xs:element> 
        <xs:element minOccurs="0" name="timestamp" type="xs:dateTime"> 
         <xs:annotation> 
          <xs:documentation/> 
          <xs:appinfo> 
           <CallInfo> 
            <AllCalls/> 
            <Returned>Always</Returned> 
           </CallInfo> 
          </xs:appinfo> 
         </xs:annotation> 
        </xs:element> 
        <xs:element maxOccurs="unbounded" minOccurs="0" name="extension" type="tns:ExtensionType"/> 
       </xs:sequence> 
      </xs:complexType> 
      <xs:simpleType name="ErrorCategory"> 
       <xs:annotation> 
        <xs:documentation> 
         Documentation goes here. 
        </xs:documentation> 
        <xs:appinfo> 
         <typeLibrarySource library="SOACommon" namespace="http://www.host.com/CommercialPlace/services"/> 
        </xs:appinfo> 
       </xs:annotation> 
       <xs:restriction base="xs:token"> 
        <xs:enumeration value="System"/> 
        <xs:enumeration value="Application"/> 
        <xs:enumeration value="Request"/> 
       </xs:restriction> 
      </xs:simpleType> 
      <xs:complexType name="ErrorData"> 
       <xs:annotation> 
        <xs:documentation> 
         Documentation goes here 
        </xs:documentation> 
        <xs:appinfo> 
         <typeLibrarySource library="SOACommon" namespace="http://www.host.com/CommercialPlace/services"/> 
        </xs:appinfo> 
       </xs:annotation> 
       <xs:sequence> 
        <xs:element name="errorId" type="xs:long"/> 
        <xs:element name="domain" type="xs:string"/> 
        <xs:element minOccurs="0" name="subdomain" type="xs:string"/> 
        <xs:element name="severity" type="tns:ErrorSeverity"/> 
        <xs:element name="category" type="tns:ErrorCategory"/> 
        <xs:element name="message" type="xs:string"/> 
        <xs:element minOccurs="0" name="exceptionId" type="xs:token"/> 
        <xs:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="tns:ErrorParameter"/> 
       </xs:sequence> 
      </xs:complexType> 
      <xs:complexType name="ErrorMessage"> 
       <xs:annotation> 
        <xs:documentation> 
         Documentation goes here 
        </xs:documentation> 
        <xs:appinfo> 
         <typeLibrarySource library="SOACommon" namespace="http://www.host.com/CommercialPlace/services"/> 
        </xs:appinfo> 
       </xs:annotation> 
       <xs:sequence> 
        <xs:element maxOccurs="unbounded" minOccurs="0" name="error" type="tns:ErrorData"/> 
       </xs:sequence> 
      </xs:complexType> 
      <xs:complexType name="ErrorParameter"> 
       <xs:annotation> 
        <xs:documentation> 
         Documentation goes here 
        </xs:documentation> 
        <xs:appinfo> 
         <typeLibrarySource library="SOACommon" namespace="http://www.host.com/CommercialPlace/services"/> 
        </xs:appinfo> 
       </xs:annotation> 
       <xs:simpleContent> 
        <xs:extension base="xs:string"> 
         <xs:attribute name="name" type="xs:string" use="optional"/> 
        </xs:extension> 
       </xs:simpleContent> 
      </xs:complexType> 
      <xs:simpleType name="ErrorSeverity"> 
       <xs:annotation> 
        <xs:documentation> 
         Documentation goes here. 
        </xs:documentation> 
        <xs:appinfo> 
         <typeLibrarySource library="SOACommon" namespace="http://www.host.com/CommercialPlace/services"/> 
        </xs:appinfo> 
       </xs:annotation> 
       <xs:restriction base="xs:token"> 
        <xs:enumeration value="Error"/> 
        <xs:enumeration value="Warning"/> 
       </xs:restriction> 
      </xs:simpleType> 
      <xs:complexType name="ExtensionType"> 
       <xs:annotation> 
        <xs:documentation> 
         Documentation goes here 
        </xs:documentation> 
        <xs:appinfo> 
         <typeLibrarySource library="CommercialPlaceService" namespace="http://www.host.com/CommercialPlace/services"/> 
        </xs:appinfo> 
       </xs:annotation> 
       <xs:sequence> 
        <xs:element name="id" type="xs:positiveInteger"/> 
        <xs:element name="version" type="xs:string"/> 
        <xs:element name="contentType" type="xs:string"/> 
        <xs:element name="value" type="xs:string"/> 
        <xs:any maxOccurs="unbounded" minOccurs="0" processContents="lax"/> 
       </xs:sequence> 
      </xs:complexType> 
      <xs:element name="getVersionRequest" type="tns:GetVersionRequest"/> 
      <xs:complexType name="GetVersionRequest"> 
       <xs:annotation> 
        <xs:documentation> 
         Document goes here 
        </xs:documentation> 
       </xs:annotation> 
       <xs:complexContent> 
        <xs:extension base="tns:BaseRequest"> 
         <xs:sequence/> 
        </xs:extension> 
       </xs:complexContent> 
      </xs:complexType> 
      <xs:element name="getVersionResponse" type="tns:GetVersionResponse"/> 
      <xs:complexType name="GetVersionResponse"> 
       <xs:annotation> 
        <xs:documentation> 
         Document goes here 
        </xs:documentation> 
       </xs:annotation> 
       <xs:complexContent> 
        <xs:extension base="tns:BaseResponse"> 
         <xs:sequence/> 
        </xs:extension> 
       </xs:complexContent> 
      </xs:complexType> 

      <xs:element name="getLocationByIpRequest" nillable="true" type="tns:GetLocationByIpRequest"/> 
      <xs:complexType name="GetLocationByIpRequest"> 
       <xs:annotation> 
        <xs:documentation> 
         The client IP address in the readable format 
         (string format) 
        </xs:documentation> 
       </xs:annotation> 
       <xs:complexContent> 
        <xs:extension base="tns:BaseRequest"> 
         <xs:sequence> 
          <xs:element maxOccurs="1" minOccurs="1" name="ipAddress" type="xs:string"/> 
         </xs:sequence> 
        </xs:extension> 
       </xs:complexContent> 
      </xs:complexType> 
      <xs:complexType name="LocationType"> 
       <xs:annotation> 
        <xs:documentation>This defines a user's geo location information</xs:documentation> 
       </xs:annotation> 
       <xs:sequence> 
        <xs:element name="country" type="xs:string"> 
         <xs:annotation> 
          <xs:documentation>The ISO standard two-letter country code</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element minOccurs="0" name="region" type="xs:string"> 
         <xs:annotation> 
          <xs:documentation>This is a generic field that stores country's specific region information. For example, it's the State for US, the Province for Canada, etc. </xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element minOccurs="0" name="city" type="xs:string"> 
         <xs:annotation> 
          <xs:documentation>The name of the city. </xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element minOccurs="0" name="zipCode" type="xs:string"> 
         <xs:annotation> 
          <xs:documentation>This field contains country-specific postal code</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element maxOccurs="1" minOccurs="1" name="latitude" type="xs:float"> 
         <xs:annotation> 
          <xs:documentation>The latitude of the city in decimail degrees format.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element maxOccurs="1" minOccurs="1" name="longitude" type="xs:float"> 
         <xs:annotation> 
          <xs:documentation>The longitude of the city in decimal degrees format.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element minOccurs="0" name="metroCode" type="xs:string"> 
         <xs:annotation> 
          <xs:documentation>The metro code that the city belongs to.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element minOccurs="0" name="areaCode" type="xs:string"> 
         <xs:annotation> 
          <xs:documentation>The phone area code of the city.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:sequence> 
      </xs:complexType> 
      <xs:element name="getLocationByIpResponse" nillable="true" type="tns:GetLocationByIpResponse"/> 
      <xs:complexType name="GetLocationByIpResponse"> 
       <xs:annotation> 
        <xs:documentation> 
         Defines the getLocationByIp response object. 
         It contains a single location information 
         that matches the user's IP address. 
        </xs:documentation> 

       </xs:annotation> 
       <xs:complexContent> 
        <xs:extension base="tns:BaseResponse"> 
         <xs:sequence> 
          <xs:element maxOccurs="1" minOccurs="0" name="location" type="tns:LocationType"/> 
         </xs:sequence> 
        </xs:extension> 
       </xs:complexContent> 
      </xs:complexType> 
      <!-- GCS: Geographic Coordinate System: latitude & longitude --> 
      <xs:complexType name="GCSInfo"> 
       <xs:sequence> 
        <xs:element maxOccurs="1" minOccurs="1" name="latitude" type="xs:float"> 
         <xs:annotation> 
          <xs:documentation>The geo latitude of a user's device.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element maxOccurs="1" minOccurs="1" name="longitude" type="xs:float"> 
         <xs:annotation> 
          <xs:documentation>The geo longitude of a user's device.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element maxOccurs="1" minOccurs="1" name="radius" type="xs:float"> 
         <xs:annotation> 
          <xs:documentation>The radius that defines a circular searching area that is centered at the user's device.</xs:documentation> 
         </xs:annotation> 
        </xs:element> 
        <xs:element maxOccurs="1" minOccurs="0" name="radiusUnit" type="xs:token"> 
         <xs:annotation> 
          <xs:documentation> 
          Specifies the unit of radius as one of these options: mile or km (kilometer). If this element is missing, the default is mile. 
         </xs:documentation> 
         </xs:annotation> 
        </xs:element> 
       </xs:sequence> 
      </xs:complexType> 
      <xs:element name="getLocationRequest" nillable="true" type="tns:getLocationRequest"/> 
      <xs:complexType name="getLocationRequest"> 
       <xs:annotation> 
        <xs:documentation> 
         Defines the getLocation request object. GCS 
         stands for Geographic Coordinate Systems. It has 
         three required fields: the latitude, longitude 
         of current user's device location and the radius 
         that defines a circular area centered at the 
         user's device location. 
        </xs:documentation> 
       </xs:annotation> 
       <xs:complexContent> 
        <xs:extension base="tns:BaseRequest"> 
         <xs:sequence> 
          <xs:element maxOccurs="1" minOccurs="1" name="gcsInfo" type="tns:GCSInfo"> 
           <xs:annotation> 
            <xs:documentation> 
             It specifies the GCS information: 
             latitude and longitude of a user's 
             device, the radius and its unit. 
            </xs:documentation> 
           </xs:annotation> 
          </xs:element> 
         </xs:sequence> 
        </xs:extension> 
       </xs:complexContent> 
      </xs:complexType> 
      <xs:element name="getLocationResponse" nillable="true" type="tns:getLocationResponse"/> 
      <xs:complexType name="getLocationResponse"> 
       <xs:complexContent> 
        <xs:extension base="tns:BaseResponse"> 
         <xs:sequence> 
          <xs:element maxOccurs="unbounded" minOccurs="0" name="location" type="tns:LocationType"> 
           <xs:annotation> 
            <xs:documentation> 
             A list of locations that are 
             within the circular searching 
             area if any is found. 
            </xs:documentation> 
           </xs:annotation> 
          </xs:element> 
         </xs:sequence> 
        </xs:extension> 
       </xs:complexContent> 
      </xs:complexType> 
     </xs:schema> 
    </types> 
    <message name="getVersionRequest"> 
     <part name="versionRequest" element="tns:getVersionRequest"> 
     </part> 
    </message> 
    <message name="getVersionResponse"> 
     <part name="versionResponse" element="tns:getVersionResponse"> 
     </part> 
    </message> 
    <message name="getLocationResponse"> 
     <part name="byGCSResponse" element="tns:getLocationResponse"> 
    </part> 
    </message> 
    <message name="getLocationByIpRequest"> 
     <part name="byIpRequest" element="tns:getLocationByIpRequest"> 
    </part> 
    </message> 
    <message name="getLocationRequest"> 
     <part name="byGCSRequest" element="tns:getLocationRequest"> 
    </part> 
    </message> 
    <message name="getLocationByIpResponse"> 
     <part name="byIpResponse" element="tns:getLocationByIpResponse"> 
    </part> 
    </message> 
    <portType name="TrackIntlServicePort"> 
     <operation name="getVersion"> 
      <wsdl:documentation> 
       Documentation goes here. 
      </wsdl:documentation> 
      <input message="tns:getVersionRequest"> 
      </input> 
      <output message="tns:getVersionResponse"> 
      </output> 
     </operation> 
     <operation name="getLocationByIp"> 
      <input message="tns:getLocationByIpRequest"> 
      </input> 
      <output message="tns:getLocationByIpResponse"> 
      </output> 
     </operation> 
     <operation name="getLocation"> 
      <input message="tns:getLocationRequest"> 
      </input> 
      <output message="tns:getLocationResponse"> 
      </output> 
     </operation> 
    </portType> 
    <binding name="TrackIntlServiceHttpBinding" type="tns:TrackIntlServicePort"> 
     <http:binding verb="POST"/> 
     <operation name="getVersion"> 
      <http:operation location="/getVersion"/> 
      <input> 
       <mime:content part="versionRequest" type="application/x-www-form-urlencoded"/> 
      </input> 
      <output> 
       <mime:content part="versionResponse" type="text/xml"/> 
      </output> 
     </operation> 
     <operation name="getLocationByIp"> 
      <http:operation location="/getLocationByIp"/> 
      <input> 
       <mime:content part="byIpRequest" type="application/x-www-form-urlencoded"/> 
      </input> 
      <output> 
       <mime:content part="byIpResponse" type="text/xml"/> 
      </output> 
     </operation> 
     <operation name="getLocation"> 
      <http:operation location="/getLocation"/> 
       <input> 
        <mime:content part="byGCSRequest" type="application/x-www-form-urlencoded"/> 
       </input> 
       <output> 
        <mime:content part="byGCSResponse" type="text/xml"/> 
       </output> 
     </operation> 
    </binding> 
    <binding name="TrackIntlServiceSOAPBinding" type="tns:TrackIntlServicePort"> 
     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
     <operation name="getVersion"> 
      <soap:operation soapAction="http://www.host.com/CommercialPlace/tax/v1/services/getVersion"/> 
      <input> 
       <soap:body use="literal"/> 
      </input> 
      <output> 
       <soap:body use="literal"/> 
      </output> 
     </operation> 
     <operation name="getLocationByIp"> 
      <soap:operation soapAction="http://www.host.com/CommercialPlace/marketing/v1/services/getLocationByIp"/> 
      <input> 
       <soap:body use="literal"/> 
      </input> 
      <output> 
       <soap:body use="literal"/> 
      </output> 
     </operation> 
     <operation name="getLocation"> 
      <soap:operation soapAction="http://www.host.com/CommercialPlace/marketing/v1/services/getLocation"/> 
      <input> 
       <soap:body use="literal"/> 
      </input> 
      <output> 
       <soap:body use="literal"/> 
      </output> 
     </operation> 
    </binding> 
    <service name="TrackIntlService"> 
     <wsdl:documentation> 
      <version>1.0.0</version> 
     </wsdl:documentation> 
     <port name="TrackIntlServiceSOAPPort" binding="tns:TrackIntlServiceSOAPBinding"> 
      <soap12:address location="http://svcs.host.com/services/marketing/v1/TrackIntlService"/> 
     </port> 
     <port name="TrackIntlServiceHttpPort" binding="tns:TrackIntlServiceHttpBinding"> 
      <http:address location="http://svcs.host.com/services/marketing/v1/TrackIntlService"/> 
     </port> 
    </service> 
</definitions> 

任何建議將理解?

回答

0

WSDL的第529行有一個錯誤。相反的:

<soap12:address location="http://svcs.host.com/services/personalization/v1/TrackingIntlService"/> 

它應該是:

<soap:address location="http://svcs.host.com/services/personalization/v1/TrackingIntlService"/> 
+0

你肯定..?這將是肥皂不肥皂12?因爲我沒有太多的SOA和WSDL經驗。 – ferhan 2012-02-16 04:10:04

+0

是的,我確定。 WSDL 2中沒有端口,它已被端點替代。在一個側面說明,它可能不是一個好主意,在同一個WSDL文件混合WSDL 1.1和WSDL 2.0模式。 – Perception 2012-02-16 04:28:01