使用axis2 eclipse插件从wsdl生成java代码

时间:2012-09-27 08:09:39

标签: java web-services soap wsdl axis2

我有以下wsdl,我需要从中生成服务器java代码:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
            xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
            xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
            xmlns:tns="http://www.smarttrust.com/mdm/clientprovisioning_1.0/initiator" 
            xmlns:types="http://www.smarttrust.com/mdm/clientprovisioning_1.0/initiator-types" 
            xmlns:common="http://www.smarttrust.com/mdm/clientprovisioning_1.0/common" 
            targetNamespace="http://www.smarttrust.com/mdm/clientprovisioning_1.0/initiator">
    <types>
        <documentation>ClientProvisioningInitiator types are defined in web-clientprovisioning-initiator-types.xsd. 
            Types common with ClientProvisioningService are defined in web-clientprovisioning-common.xsd.
        </documentation>
        <xsd:schema targetNamespace="http://www.smarttrust.com/mdm/clientprovisioning_1.0/initiator">
            <xsd:import namespace="http://www.smarttrust.com/mdm/clientprovisioning_1.0/initiator-types" 
                schemaLocation="web-clientprovisioning-initiator-types.xsd"/>
        </xsd:schema>
    </types>
    <message name="cpDiscovery.Response">
        <documentation></documentation>
        <part name="cpDiscovery.Response" type="types:cpDiscovery.ResponseType"/>
    </message>
    <message name="cpStatus">
        <documentation></documentation>
        <part name="cpStatus" type="types:cpStatusType"/>
    </message>
    <portType name="ClientProvisioningInitiator">
        <documentation>Counterpart for the ClientProvisioningService</documentation>
        <operation name="cpDiscovery.Response">
            <documentation>Receives a response with profile information</documentation>
            <input message="tns:cpDiscovery.Response"/>
        </operation>
        <operation name="cpStatus">
            <documentation>Receives status notifications on what happens with the request and the execution status of the server.
            </documentation>
            <input message="tns:cpStatus"/>
        </operation>
    </portType>
    <binding name="clientProvisioningSOAPBinding" type="tns:ClientProvisioningInitiator">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="cpStatus">
            <soap:operation soapAction="urn:#cpStatus"/>
            <input>
                <soap:body use="literal"/>
            </input>
        </operation>
        <operation name="cpDiscovery.Response">
            <soap:operation soapAction="urn:#cpDiscovery.Response"/>
            <input>
                <soap:body use="literal"/>
            </input>
        </operation>
    </binding>
    <service name="ClientProvisioningInitiator">
        <port name="ClientProvisioningInitiator" binding="tns:clientProvisioningSOAPBinding">
            <soap:address location="http://localhost/#"/>
        </port>
    </service>
</definitions>

当我尝试使用eclipse axis2插件生成代码时,我得到了java.langInterruptedException,没有为消息cpStatus定义元素类型。怎么了?

1 个答案:

答案 0 :(得分:0)

<message name="cpStatus">
    <documentation></documentation>
    <part name="cpStatus" type="types:cpStatusType"/>
</message>

某处需要定义cpStatusType,而不是{{1}}。需要包含其他xml或添加更多行到此xml