简体   繁体   中英

Generating java from wsdl and xsd error

I am a beginner in wsdl/xsd trying to generate Java classes with the following two files

I am getting a number of errors from wsdl2java including the wsdl file defines no services, and that elements from the xsd file cannot be found.

Does anyone know what the problem might be?

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>

Here is what I found to be wrong with the 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>

The element tags are refering to the element Types not the elements themselves These should be changed to

<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>

Also the wsdl should define a binding and a service.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM