NullPointerException in WSDL2Java when WSDL-Operation has no InputMessage
-------------------------------------------------------------------------
Key: AXIS2-4380
URL: https://issues.apache.org/jira/browse/AXIS2-4380
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Components: codegen
Affects Versions: 1.5
Environment: Windows Vista Business 64bit
Java 1.6.0_7
Reporter: Christoph Müller
Priority: Minor
When invoking WSDL2Java for JiBX, a NullPointerException is thrown. The WSDL
has an operation without an input message.
## Parameters #####################################
-uri wsdl\HospitalWebservice.wsdl
-p de.ahija.da.simplews.server
-d jibx
-ss
-sd
-ssi
-uw
-S gen
-R WebContent/META-INF
-or
#################################################
## Exception ######################################
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:153)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: org.apache.axis2.AxisFault
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:396)
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:142)
... 2 more
Caused by: java.lang.NullPointerException
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateOperations(WSDL11ToAxisServiceBuilder.java:1340)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populatePortType(WSDL11ToAxisServiceBuilder.java:591)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpoints(WSDL11ToAxisServiceBuilder.java:468)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:362)
... 3 more
#################################################
When debugging, the cause became obvious:
http://svn.apache.org/repos/asf/webservices/axis2/tags/java/v1.5/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
## WSDL11ToAxisServiceBuilder ######################
1336 Message message = wsdl4jOutputMessage.getMessage();
1337 if (null != message) {
1338
1339 outMessage.setName(message.getQName().getLocalPart());
1340
copyExtensionAttributes(wsdl4jInputMessage.getExtensionAttributes(),
1341 outMessage,
PORT_TYPE_OPERATION_OUTPUT);
1342
1343 // wsdl:portType -> wsdl:operation -> wsdl:output
1344 }
#################################################
While wsdl4jInputMessage was checked for null various times before, here it is
not checked. Moreover I assume it is a copy'n'paste mistake and
wsdl4jOutputMessage should be used here.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.