2013-07-24 24 views
0
<?xml version="1.0" encoding="UTF-8"?> 
<definitions xmlns:tns="http://schemas.ocbc.com/soa/WSDL/service/CBS-CustAddress-I" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://schemas.ocbc.com/soa/emf/common/envelope/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://schemas.ocbc.com/soa/WSDL/service/CBS-CustAddress-I"> 
    <import namespace="http://schemas.ocbc.com/soa/emf/common/envelope/" location="../Schemas/XML/CBS-CustAddress-I-ServiceEnvelope.xsd"/> 
    <message name="InputMessage"> 
     <part name="InputMessage" element="ns:ServiceEnvelope"/> 
    </message> 
    <message name="OutMessage"> 
     <part name="OutMessage" element="ns:ServiceEnvelope"/> 
    </message> 
    <message name="FaultMessage"> 
     <part name="FaultMessage" element="ns:ServiceEnvelope"/> 
    </message> 
    <portType name="PortType"> 
     <operation name="Operation"> 
      <input message="tns:InputMessage"/> 
      <output message="tns:OutMessage"/> 
      <fault name="fault1" message="tns:FaultMessage"/> 
     </operation> 
    </portType> 
</definitions> 

我想在Eclipse中爲上述WSDL生成客戶端,但出現以下錯誤。 的Java 1.7日食開普勒生成客戶端代碼,WSDLWSDL客戶端生成不完整不是簡單類型錯誤?

IWAB0399E Error in generating Java from WSDL: java.io.IOException: Error: attribute is of type {http://schemas.ocbc.com/soa/emf/common/envelope/}encodingStyle, which is not a simple type 
    java.io.IOException: Error: attribute is of type {http://schemas.ocbc.com/soa/emf/common/envelope/}encodingStyle, which is not a simple type 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.java:1043) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.java:1119) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.java:1119) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populateTypes(SymbolTable.java:909) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:705) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.java:1092) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.java:1119) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.java:1119) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.java:1119) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.addTypes(SymbolTable.java:1119) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populateTypes(SymbolTable.java:909) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:705) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:543) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518) 
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495) 
    at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361) 
    at java.lang.Thread.run(Unknown Source) 

CBS-CustAddress-I-ServiceEnvelope.XSD:

<?xml version="1.0" encoding="UTF-8"?> 

<schema xmlns="http://www.w3.org/2001/XMLSchema" 
xmlns:emf-envelope="http://schemas.ocbc.com/soa/emf/common/envelope/" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:emf-header="http://schemas.ocbc.com/soa/emf/common/header" 
xmlns:emf-body="http://schemas.ocbc.com/soa/emf/common/body" 
xmlns:CBS-CustAddress-I="http://schemas.ocbc.com/soa/emf/service/CBS-CustAddress-I" 
targetNamespace="http://schemas.ocbc.com/soa/emf/common/envelope/" 
elementFormDefault="unqualified" 
attributeFormDefault="unqualified"> 
<import namespace="http://schemas.ocbc.com/soa/emf/common/header" schemaLocation="../../../../Schemas/XML/CommonHeader.xsd"/> 
<import namespace="http://schemas.ocbc.com/soa/emf/common/body" schemaLocation="../../../../Schemas/XML/CommonBody.xsd"/> 
<import namespace="http://schemas.ocbc.com/soa/emf/service/CBS-CustAddress-I" schemaLocation="CBS-CustAddress-I.xsd"/> 
<attributeGroup name="encodingStyle"> 
    <attribute ref="emf-envelope:encodingStyle"/> 
</attributeGroup> 

<!-- Envelope, header and body --> 
<element name="ServiceEnvelope" type="emf-envelope:ServiceEnvelope"/> 
<complexType name="ServiceEnvelope"> 
    <sequence> 
     <element ref="emf-envelope:ServiceHeader" minOccurs="0"/> 
     <element ref="emf-envelope:ServiceBody"/> 
     <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> 
    </sequence> 
    <anyAttribute namespace="##other" processContents="lax"/> 
</complexType> 
<element name="ServiceHeader" type="emf-envelope:ServiceHeader"/> 
<complexType name="ServiceHeader"> 
    <sequence> 
     <element ref="emf-header:CommonDetail"/> 
     <choice> 
      <element ref="emf-header:ClientDetail"/> 
      <element ref="emf-header:ProviderDetail"/> 
     </choice> 
     <element ref="emf-header:SecurityDetail" minOccurs="0"/> 
    </sequence> 
</complexType> 
<element name="ServiceBody" type="emf-envelope:ServiceBody"/> 
<complexType name="ServiceBody"> 
    <choice> 
     <element ref="CBS-CustAddress-I:RqDetail"/> 
     <element ref="CBS-CustAddress-I:RsDetail"/> 
     <element ref="emf-body:Error"/> 
    </choice> 
    <anyAttribute namespace="##any" processContents="lax"/> 
</complexType> 
<element name="CommonDetail" type="emf-envelope:CommonDetail"/> 
<complexType name="CommonDetail"> 
    <sequence> 
     <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> 
    </sequence> 
    <anyAttribute namespace="##any" processContents="lax"/> 
</complexType> 

<!-- Global Attributes. The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. --> 
<attribute name="mustUnderstand"> 
    <simpleType> 
     <restriction base="xs:boolean"> 
      <pattern value="0|1"/> 
     </restriction> 
    </simpleType> 
</attribute> 
<attribute name="actor" type="xs:anyURI"/> 
<simpleType name="encodingStyle"> 
    <annotation> 
     <documentation>'encodingStyle' indicates any canonicalization conventions followed in the contents of the containing element. For example, the value 'http://schemas.xmlsoap.org/soap/encoding/' indicates the pattern described in SOAP specification</documentation> 
    </annotation> 
    <list itemType="xs:anyURI"/> 
</simpleType> 
<attribute name="encodingStyle" type="emf-envelope:encodingStyle"/> 

@ vineeth:XSD根據要求連接

如果您想要參考,我還包括了CBS-CustAddress-I.XSD。

<?xml version = "1.0" encoding = "UTF-8"?> 

    <xsd:schema xmlns = "http://schemas.ocbc.com/soa/emf/service/CBS-CustAddress-I" 
targetNamespace = "http://schemas.ocbc.com/soa/emf/service/CBS-CustAddress-I" 
xmlns:emf-aggregates = "http://schemas.ocbc.com/soa/emf/common/aggregates" 
xmlns:xsd = "http://www.w3.org/2001/XMLSchema" 
xmlns:emf-elements = "http://schemas.ocbc.com/soa/emf/common/elements" 
version = "1.0.01" 
elementFormDefault = "qualified"> 
<xsd:import namespace = "http://schemas.ocbc.com/soa/emf/common/aggregates" schemaLocation = "../../../../Schemas/XML/CommonAggregates.xsd"/> 
<xsd:import namespace = "http://schemas.ocbc.com/soa/emf/common/elements" schemaLocation = "../../../../Schemas/XML/CommonElements.xsd"/> 
<xsd:element name = "RqDetail"> 
    <xsd:complexType> 
     <xsd:sequence> 
      <xsd:sequence> 
       <xsd:element ref = "emf-elements:PostalCode"/> 
      </xsd:sequence> 
      <xsd:element ref = "CountryCode" minOccurs = "0"/> 
      <xsd:element ref = "emf-aggregates:SelectionDetail" minOccurs = "0"/> 
     </xsd:sequence> 
    </xsd:complexType> 
</xsd:element> 
<xsd:element name = "RsDetail"> 
    <xsd:complexType> 
     <xsd:sequence> 
      <xsd:element ref = "emf-aggregates:AddressDetail"/> 
     </xsd:sequence> 
    </xsd:complexType> 
</xsd:element> 
<xsd:element name = "CountryCode" type = "xsd:string"/> 
    </xsd:schema> 
+0

請分享 「../Schemas/XML/CBS-CustAddress-I-ServiceEnvelope.xsd」 文件以及 –

+0

@Vineet:我想不出能張貼CBS-CustAddress-I-ServiceEnvelope .xsd ..它說你的答案太長,以便發佈...如何在這裏分享... – Peppy

+0

不要發佈在答案,發佈在問題...你可以在那裏添加長文本...只需點擊編輯您的問題 –

回答

0

首先,我有過XSD進口的擔憂:

<import namespace="http://schemas.ocbc.com/soa/emf/common/header" 
      schemaLocation="../../../../Schemas/XML/CommonHeader.xsd"/> 
    <import namespace="http://schemas.ocbc.com/soa/emf/common/body" 
      schemaLocation="../../../../Schemas/XML/CommonBody.xsd"/> 
    <import namespace="http://schemas.ocbc.com/soa/emf/service/CBS-CustAddress-I" 
      schemaLocation="CBS-CustAddress-I.xsd"/> 

schema定位需要它們是否指的正確的位置或進行檢查not..to檢查這將是理想的通過像JDeveloper這樣的IDE進行檢查。如果發現問題,它會發出警告。嘗試將這些模式放置在與所有WSDL和XSD相同的位置,並且也類似地更改路徑。

,你看到的情況可能的,因爲下面的代碼錯誤:

<attributeGroup name="encodingStyle"> 
    <attribute ref="emf-envelope:encodingStyle"/> 
</attributeGroup> 

它指的是一個位置查找定義,但失敗。

我的建議主要是2:

1)儘量簡化XSD,如果可能的話。 2)嘗試使用不同的Eclipse而不是eclipse。我更喜歡Oracle Jdeveloper,因爲它具有簡單的嚮導。

希望這有助於