在Oracle SOA Suite 11g中建模递归业务对象

时间:2010-11-09 19:40:14

标签: xml soa oracle11g business-objects

我正在尝试使用JDeveloper 11g为包含相同类型对象(Prenda)的属性的复杂业务对象(名为Prenda)建模。

这是我的xsd:

<?xml version="1.0" encoding="UTF-8"?>
<?bpmo version="11.1.1" build="6.84" fullName="Mx.Org.Frd.Bo.Prenda" modifiers="0"?>
<!--########################################################################################-->
<!--####                                                                                ####-->
<!--####          THIS IS AN AUTO GENERATED FILE. PLEASE DO NOT MANUALLY MODIFY         ####-->
<!--#### CHANGES TO THIS FILE MAY PRODUCE UNEXPECTED BEHAVIOR AND WOULD BE OVERWRITTEN  ####-->
<!--####                                                                                ####-->
<!--########################################################################################-->
<xs:schema targetNamespace="http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Prenda" xmlns:xs="http://www.w3.org/2001/XMLSchema"  xmlns:ns3="http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Reloj"  xmlns:ns2="http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Metal"  xmlns:ns1="http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Diamante"  xmlns="http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Prenda"  xmlns:bpmo="http://xmlns.oracle.com/bpm/bpmobject/" >
    <xs:import namespace="http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Reloj" schemaLocation="Reloj.xsd"/>
    <xs:import namespace="http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Diamante" schemaLocation="Diamante.xsd"/>
    <xs:import namespace="http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Metal" schemaLocation="Metal.xsd"/>
    <xs:import namespace="http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Prenda" schemaLocation="Prenda.xsd"/>
    <xs:complexType name="PrendaType">
        <xs:sequence>
            <xs:element name="id" nillable="true" type="xs:long"/>
            <xs:element name="valor" nillable="true" type="xs:decimal"/>
            <xs:element name="precioVenta" nillable="true" type="xs:decimal"/>
            <xs:element name="fechaCreacion" nillable="true" type="xs:dateTime"/>
            <xs:element name="fechaModificacion" nillable="true" type="xs:dateTime"/>
            <xs:element name="tipoPrenda" nillable="true" type="xs:string">
                <xs:annotation>
                    <xs:documentation>
                        <bpmo:documentable>
                            <bpmo:description>
                                prenda, grupo, elemento
                            </bpmo:description>
                        </bpmo:documentable>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="tipoElemento" nillable="true" type="xs:string">
                <xs:annotation>
                    <xs:documentation>
                        <bpmo:documentable>
                            <bpmo:description>
                                diamante, metal
                            </bpmo:description>
                        </bpmo:documentable>
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="diamante" type="ns1:DiamanteType"/>
            <xs:element name="metal" type="ns2:MetalType"/>
            <xs:element name="reloj" type="ns3:RelojType"/>
            <xs:element name="padre" type="PrendaType"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element name="Prenda" type="PrendaType"/>
</xs:schema>

但由于属性padre属于同一类型,因此部署复合体时遇到了麻烦:PrendaType作为我的整个对象。我收到了这个错误:

Caused by: oracle.fabric.common.wsdl.XSDException: oracle.xml.parser.schema.XSDException: imported namespace "http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Prenda" must different from  namespace "http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Prenda" [Cause=imported namespace "http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Prenda" must different from  namespace "http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Prenda"]
        at oracle.fabric.common.wsdl.SchemaManager.buildXDKSchema(SchemaManager.java:384)
        at oracle.fabric.common.wsdl.SchemaManager.lookupSchema(SchemaManager.java:216)
        at oracle.fabric.common.wsdl.SchemaManager.lookupXSDElementDeclaration(SchemaManager.java:399)
        at com.collaxa.cube.xml.xsd.SchemaToXML.generateXMLElement(SchemaToXML.java:367)

任何想法如何做到这一点?,我正在考虑遗产,但IDE没有显示扩展XSD的选项,所以我不知道是否可能。

感谢

1 个答案:

答案 0 :(得分:0)

只需删除导入语句

即可
<xs:import namespace="http://xmlns.oracle.com/bpm/bpmobject/Mx/Org/Frd/Bo/Prenda" schemaLocation="Prenda.xsd"/>

你应该没问题