I want to generate Java classes using the WSDL description of the SOAP service. This WSDL description is given in the programmer’s manual and is not available through the? Wsdl link. Here is the 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> I generate classes with the plugin org.apache.cxf. The pom.xml file is:
<?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> Before trying to generate classes for the service I needed and successfully generated them in the same project for a simple stockquote service, it was not possible to generate classes for the desired service. When I call mvn generate-sources, I get the error:
[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 How to fix this error and generate my classes? What is wrong with rpc?