NullPointerException in WSDL11ToAxisServiceBuilder when importing an output only operation ------------------------------------------------------------------------------------------
Key: AXIS2-4579 URL: https://issues.apache.org/jira/browse/AXIS2-4579 Project: Axis 2.0 (Axis2) Issue Type: Bug Components: kernel Affects Versions: 1.5 Reporter: Dave Bryant A null pointer exception occurs in WSDL11ToAxisServiceBuilder when importing the WSDL below. It includes a notification style operation (i.e. output only), and the null pointer occurs when the service builder attempts to copy across the extension elements. The problem is that it tries to copy the extension elements from the input message rather than the output message - as the input is null, a null pointer occurs. If the input message was not null this is still a bug as it is copying the extension elements from the wrong place. The bug is on line 1343 (revision 822304 from http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java). {code} 1334 // Create an output message and add 1335 Output wsdl4jOutputMessage = wsdl4jOperation.getOutput(); 1336 if (null != wsdl4jOutputMessage) { 1337 AxisMessage outMessage = axisOperation 1338 .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE); 1339 Message message = wsdl4jOutputMessage.getMessage(); 1340 if (null != message) { 1341 1342 outMessage.setName(message.getQName().getLocalPart()); 1343 copyExtensionAttributes(wsdl4jInputMessage.getExtensionAttributes(), 1344 outMessage, PORT_TYPE_OPERATION_OUTPUT); 1345 1346 // wsdl:portType -> wsdl:operation -> wsdl:output 1347 } {code} The following WSDL triggers the problem: {code:xml} <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://www.example.com/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://www.example.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"> <wsdl:message name="operationResponse"> <wsdl:part name="parameters" element="operationResponse" /> </wsdl:message> <wsdl:portType name="examplePortType"> <wsdl:operation name="operation"> <wsdl:output message="operationResponse" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="binding" type="examplePortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="operation"> <soap:operation soapAction="urn:operation" style="document" /> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="service"> <wsdl:port name="endpoint" binding="binding"> <soap:address location="https://127.0.0.1:8444/services/Service/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.