i'm reating WSDL file in eclipse from new -> other -> wsdl. I want to use "type" instead of "elements". but when i creating stub of the wsdl getting below error:
2023-04-18 11:11:24,325 main DEBUG LoggerContext\[name=45ee12a7, org.apache.logging.log4j.core.LoggerContext@76508ed1\] started OK.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
at org.apache.axis2.wsdl.codegen.CodeGenConfiguration.loadWsdl(CodeGenConfiguration.java:748)
at org.apache.axis2.wsdl.codegen.CodegenConfigLoader.loadConfig(CodegenConfigLoader.java:328)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:53)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: org.apache.axis2.AxisFault: No element type is defined for message NewOperationRequest (see WS-I BP 1.0, R2204)
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:431)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:408)
at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:107)
at org.apache.axis2.wsdl.codegen.CodeGenConfiguration.loadWsdl(CodeGenConfiguration.java:742)
... 3 more
Caused by: org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException:
No element type is defined for message NewOperationRequest (see WS-I BP 1.0, R2204)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameReference(WSDL11ToAxisServiceBuilder.java:1287)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameReference(WSDL11ToAxisServiceBuilder.java:1215)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateBinding(WSDL11ToAxisServiceBuilder.java:729)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpoint(WSDL11ToAxisServiceBuilder.java:547)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpoints(WSDL11ToAxisServiceBuilder.java:499)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:370)
... 5 more
WSDL FILE:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="urn:MRManagerService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
name="MRManagerService"
targetNamespace="urn:MRManagerService">
<wsdl:types>
<xs:schema targetNamespace="urn:MRManagerService">
<xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xs:complexType name="NewOperation">
<xs:sequence>
<xs:element name="param" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NewOperationResponse">
<xs:sequence>
<xs:element name="out" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="NewOperationRequest">
<wsdl:part type="xs:string" name="parameters"/>
</wsdl:message>
<wsdl:message name="NewOperationResponse">
<wsdl:part element="xs:string" name="parameters"/>
</wsdl:message>
<wsdl:portType name="MRManagerService">
<wsdl:operation name="NewOperation">
<wsdl:input message="tns:NewOperationRequest"/>
<wsdl:output message="tns:NewOperationResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MRManagerServiceSOAP" type="tns:MRManagerService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="NewOperation">
<soap:operation soapAction="urn:MRManagerService/NewOperation"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MRManagerService">
<wsdl:port binding="tns:MRManagerServiceSOAP" name="MRManagerServiceSOAP">
<soap:address location="http://www.example.org/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
here i'm using below AXIS2 command to generate the stubs in terminal:
$AXIS2_HOME/bin/wsdl2java.sh -uri MRManagerService.wsdl -p org.apache.axis2.axis2userguide -d adb -s