如何从wsdl编写jaxb绑定

时间:2014-10-15 07:03:31

标签: web-services jaxb wsdl jax-ws jax-rs

您好我想在wsdl中为wsdl:message下面写jaxb绑定。

<xs:element name="getSampleForBknumRequest">
    <xs:annotation>
        <xs:documentation>
        getSampleForBknumRequest Request - this is the full message document passed into the service
    </xs:documentation>
    </xs:annotation>
    <xs:complexType>
        <xs:complexContent>
            <xs:extension base="Comn:BaseRequestType">
                <xs:sequence>
                    <xs:element name="bk" type="comn:bkType" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:element>
<xs:element name="getSampleForBknumResponse">
    <xs:annotation>
        <xs:documentation>
            this is the full message document returned from the service
    </xs:documentation>
    </xs:annotation>
    <xs:complexType>
        <xs:complexContent>
            <xs:extension base="Comn:ResponseType">
                <xs:sequence>
                    <xs:element name="org" type="org:LocationDataType" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
</xs:element>

上面的相应wsdl:消息是

    <wsdl:message name="getSampleForRequest">
    <wsdl:part name="getSampleForBknumRequest" element="ns1:DB_getSampleForBknumRequest"/>
    </wsdl:message>
    <wsdl:message name="getSampleForResponse">
    <wsdl:part name="getSampleForBknumResponse" element="ns1:DB_getSampleForBknumResponse"/>
    </wsdl:message>

和相应的wsdl:操作是

    <wsdl:operation name="getSamForBknum">
    <wsdl:input name="getSampleForRequest" message="tns:getSampleForRequest"/>
    <wsdl:output name="getSampleForResponse" message="tns:getSampleForResponse"/>
    </wsdl:operation>

延续:

    <wsdl:operation name="getSampleForBk">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getSampleForRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="getSampleForResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>

我是webservices的新手,所以我不知道如何正确的jaxb绑定上面。通常我们将在jaxb:binding的架构位置给出xsd,这里我没有在同一个wsdl文件中的任何xsd的eveything 。 请有人指导我解决问题。

1 个答案:

答案 0 :(得分:0)