Java 在xsd中找不到引用
请帮助我,我知道这是一个非常简单的问题仍然需要帮助。 请参考以下模式Java 在xsd中找不到引用,java,xml,web-services,jdeveloper,Java,Xml,Web Services,Jdeveloper,请帮助我,我知道这是一个非常简单的问题仍然需要帮助。 请参考以下模式 <?xml version="1.0" encoding="UTF-8"?> <schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlns.oracle.com/RegistrationUpload_jws/RegistrationUpload/Ta
<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/RegistrationUpload_jws/RegistrationUpload/Taskprocess"
xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="officer" id="officer" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<sequence>
<element name="mainOfficer" type="string"/>
<element name="mainOfficerId" type="string"/>
<element name="coveringOfficer" type="string"/>
<element name="coveringOfficerId" type="string"/>
<element name="defaultOfficer" type="string"/>
<element name="defaultOfficerId" type="string"/>
<element name="matrixId" type="string"/>
</sequence>
</complexType>
<element name="process">
<complexType>
<sequence>
<element name="input" id="officer" type="officer" nillable="false"
maxOccurs="1" minOccurs="0"/>
</sequence>
</complexType>
</element>
<element name="processResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
我发现问题参考办公室未找到(使用Jdeveloper)我认为问题与名称空间有关。文档的默认名称空间是
http://www.w3.org/2001/XMLSchema
这意味着您可以引用不带前缀的XML内置类型,如type=“string”
中所述。但是,类型officer
存在于目标名称空间中,因此当您引用该类型时,必须使用名称空间绑定对其进行限定。将其添加到模式
元素:
xmlns:tns="http://xmlns.oracle.com/RegistrationUpload_jws/RegistrationUpload/Taskprocess"
并在提及官员类型时使用tns前缀:
<element name="input" type="tns:officer" nillable="false" ... />
(另外,id属性的使用很奇怪,尤其是因为您有重复的内容。)您能提供有关错误的更多信息吗?你什么时候拿到的?您的XML文件可能与XSD不匹配吗?谢谢,我已经粘贴了整个XML文件内容。。问题是我正在使用Jdeveloper创建BPEL流程。因此,当我们自动创建BPEL时,将创建xsd文件,然后我的要求是将输入参数设置为复杂类型。所以我在xsd中进行了更改,发现了这个错误。。。。错误是“找不到官员的参考资料”,希望收到您的来信……您首先说问题名称是“办公室”,然后说是“官员”。实际上,它是“军官”。错误地获取这样的基本信息会使人们更难帮助你。请再努力一点。谢谢,我也试过了,错误被消除了。但在我的wsdl文件中,元素“processResponse”和“process”出现了另一个错误。我是否也需要更改wsdl文件。如果没有更多信息,很难说。