Java SOAP сгенерировать классы плагином cxf

250
10 августа 2018, 22:30

Хочу сгенерировать джава-классы по WSDL-описанию SOAP-сервиса. Это WSDL-описание дается в руководстве программиста и недоступно по ссылке ?wsdl. Вот wsdl:

<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="IEtranSysservice" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:SysEtranIntf">
    <message name="SendBlockRequest">
        <part name="Text" type="xs:string"/>
    </message>
    <message name="SendBlockResponse">
        <part name="return" type="xs:boolean"/>
    </message>
    <message name="GetBlockRequest">
        <part name="Login" type="xs:string"/>
        <part name="Password" type="xs:string"/>
        <part name="Text" type="xs:string"/>
    </message>
    <message name="GetBlockResponse">
        <part name="Text" type="xs:string"/>
        <part name="return" type="xs:boolean"/>
    </message>
    <portType name="IEtranSys">
        <operation name="SendBlock">
            <input message="tns:SendBlockRequest"/>
            <output message="tns:SendBlockResponse"/>
        </operation>
        <operation name="GetBlock">
            <input message="tns:GetBlockRequest"/>
            <output message="tns:GetBlockResponse"/>
        </operation>
    </portType>
    <binding name="IEtranSysbinding" type="tns:IEtranSys">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="SendBlock">
            <soap:operation soapAction="urn:SysEtranInt" style="rpc"/>
            <input>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="SysEtranInt"/>
            </input>
            <output>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="SysEtranInt"/>
            </output>
        </operation>
        <operation name="GetBlock">
            <soap:operation soapAction="urn:SysEtranInt" style="rpc"/>
            <input>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="SysEtranInt"/>
            </input>
            <output>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="SysEtranInt"/>
            </output>
        </operation>
    </binding>
    <service name="IEtranSysservice">
        <port name="IEtranSysPort" binding="tns:IEtranSysbinding">
            <soap:address location="http://10.248.35.14:8092/EtranServer/EtranLR.dll/soap"/>
        </port>
    </service>
</definitions>

Генерирую классы плагином org.apache.cxf. Файл pom.xml такой:

<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="IEtranSysservice" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:SysEtranIntf">
    <message name="SendBlockRequest">
        <part name="Text" type="xs:string"/>
    </message>
    <message name="SendBlockResponse">
        <part name="return" type="xs:boolean"/>
    </message>
    <message name="GetBlockRequest">
        <part name="Login" type="xs:string"/>
        <part name="Password" type="xs:string"/>
        <part name="Text" type="xs:string"/>
    </message>
    <message name="GetBlockResponse">
        <part name="Text" type="xs:string"/>
        <part name="return" type="xs:boolean"/>
    </message>
    <portType name="IEtranSys">
        <operation name="SendBlock">
            <input message="tns:SendBlockRequest"/>
            <output message="tns:SendBlockResponse"/>
        </operation>
        <operation name="GetBlock">
            <input message="tns:GetBlockRequest"/>
            <output message="tns:GetBlockResponse"/>
        </operation>
    </portType>
    <binding name="IEtranSysbinding" type="tns:IEtranSys">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="SendBlock">
            <soap:operation soapAction="urn:SysEtranInt" style="rpc"/>
            <input>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="SysEtranInt"/>
            </input>
            <output>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="SysEtranInt"/>
            </output>
        </operation>
        <operation name="GetBlock">
            <soap:operation soapAction="urn:SysEtranInt" style="rpc"/>
            <input>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="SysEtranInt"/>
            </input>
            <output>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="SysEtranInt"/>
            </output>
        </operation>
    </binding>
    <service name="IEtranSysservice">
        <port name="IEtranSysPort" binding="tns:IEtranSysbinding">
            <soap:address location="http://10.248.35.14:8092/EtranServer/EtranLR.dll/soap"/>
        </port>
    </service>
</definitions>

Перед тем, как попытаться сгенерировать классы для нужного мне сервиса и успешно сгенерировал их в этом же проекте для простого сервиса stockquote, но сгенерировать классы для нужного сервиса не удалось. При вызове mvn generate-sources получаю ошибку:

[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.7.7:wsdl2java (generate-sources) on project soap: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.7.7:wsdl2java failed: Rpc/encoded wsdls are not supported with CXF -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Как исправить эту ошибку и сгенерировать мои классы? Что не так с rpc?

READ ALSO
Проблема с Scanner

Проблема с Scanner

Такая проблема, хочу, чтобы при нажатии клавиши объект "gena" перемещался в следующую клеткуПосле создания переменной типа int со сканнером Scanner...

178
Вывод символа из слова в консоли

Вывод символа из слова в консоли

Помогите написать программу ,которая будет запускаться из терминала или консолиОна должна брать данные из строки запуска программы:

187
Класс CellRangeAddress библиотека POI

Класс CellRangeAddress библиотека POI

При записи в файл Excel воспользовался классом объединения ячеек CellRangeAddressВ объединенные ячейки было добавлено повторное значение:

143