[英]Generating java from wsdl and xsd error
我是wsdl / xsd的初学者,尝试使用以下两个文件生成Java类
我从wsdl2java中收到许多错误,包括wsdl文件未定义任何服务,并且找不到xsd文件中的元素。
有谁知道可能是什么问题?
ChipDataJob.xsd
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://contmgmt.ecm.omega/WorkspaceManager/ChipDataJob"
targetNamespace="http://contmgmt.ecm.omega/WorkspaceManager/ChipDataJob"
elementFormDefault="qualified" attributeFormDefault="qualified">
<xs:element name="dataChipperJob" type="tns:ChipJob"></xs:element>
<xs:element name="dataChipperResponse" type="xs:long"></xs:element>
<xs:element name="cancelResponse" type="xs:boolean"></xs:element>
<xs:complexType name="ChipJob">
<xs:sequence>
<xs:element name="outputFilename" type="xs:string">
</xs:element>
<xs:element name="uuidDataObjects">
<xs:simpleType>
<xs:list itemType="xs:string" />
</xs:simpleType>
</xs:element>
<xs:element name="parameters" type="tns:ChipParameters"></xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ChipParameters">
<xs:all>
<xs:element name="chipStartTime" type="xs:double">
</xs:element>
<xs:element name="chipEndTime" type="xs:double">
</xs:element>
<xs:element name="fillDuration" type="xs:float">
</xs:element>
<xs:element name="GapFillMethod">
<xs:simpleType final="restriction">
<xs:restriction base="xs:string">
<xs:enumeration value="NONE" />
<xs:enumeration value="ZERO_FILL" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="StitchMarkerFormat">
<xs:simpleType final="restriction">
<xs:restriction base="xs:string">
<xs:enumeration value="NONE" />
<xs:enumeration value="FILL" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="SequenceMethod">
<xs:simpleType final="restriction">
<xs:restriction base="xs:string">
<xs:enumeration value="TIMECODE" />
<xs:enumeration value="MANUAL" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:schema>
DataChipper.wsdl
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://contmgmt.ecm.omega/WorkspaceManager/ChipDataJob"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://contmgmt.ecm.omega/WorkspaceManager/ChipDataJob">
<wsdl:types>
<xsd:schema
targetNamespace="http://contmgmt.ecm.omega/WorkspaceManager/ChipDataJob"
xmlns:tns="http://contmgmt.ecm.omega/WorkspaceManager/ChipDataJob"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="qualified">
<xsd:include schemaLocation="ChipDataJob.xsd" />
</xsd:schema>
</wsdl:types>
<!-- Chip Message -->
<wsdl:message name="dataChipperJob">
<wsdl:part name="job" element="tns:ChipJob" />
</wsdl:message>
<wsdl:message name="dataChipperResponse">
<wsdl:part name="taskId" element="xs:long" />
</wsdl:message>
<wsdl:message name="cancelResponse">
<wsdl:part name="cancelSuccess" element="xs:boolean" />
</wsdl:message>
<wsdl:portType name="DataChipperServicePort">
<wsdl:operation name="submitRequest">
<wsdl:input message="tns:dataChipperJob"/>
<wsdl:output message="tns:dataChipperResponse"/>
</wsdl:operation>
<wsdl:operation name="cancelRequest">
<wsdl:input message="tns:dataChipperResponse"/>
<wsdl:output message="tns:cancelResponse"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
这是我发现wsdl错误的地方。
<wsdl:message name="dataChipperJob">
<wsdl:part name="job" element="tns:ChipJob" />
</wsdl:message>
<wsdl:message name="dataChipperResponse">
<wsdl:part name="taskId" element="xs:long" />
</wsdl:message>
<wsdl:message name="cancelResponse">
<wsdl:part name="cancelSuccess" element="xs:boolean" />
</wsdl:message>
元素标签引用的是元素类型,而不是元素本身。这些应更改为
<wsdl:message name="dataChipperJob">
<wsdl:part name="job" element="tns:dataChipperJob" />
</wsdl:message>
<wsdl:message name="dataChipperResponse">
<wsdl:part name="taskId" element="tns:dataChipperResponse" />
</wsdl:message>
<wsdl:message name="cancelResponse">
<wsdl:part name="cancelSuccess" element="tns:cancelResponse" />
</wsdl:message>
另外,wsdl应该定义绑定和服务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.