2013-07-24 21 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,因为它具有简单的向导。

希望这有助于