axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amila Chinthaka Suriarachchi (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AXIS2-1851) Null pointer exception when using the WSDL2Java tool
Date Fri, 15 Dec 2006 05:58:24 GMT
     [ http://issues.apache.org/jira/browse/AXIS2-1851?page=all ]

Amila Chinthaka Suriarachchi updated AXIS2-1851:
------------------------------------------------

    Attachment: axis2_kernal_patch.txt

This line <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/> causes
the problem. Always axis2 expects a child element for document element. 

 if (documentationElement != null) {
                Node firstChild = documentationElement.getFirstChild();
                String serviceDes;
                if (firstChild.getNodeType() == Node.TEXT_NODE) {
                    serviceDes = firstChild.getNodeValue();
                } else {
                    serviceDes = DOM2Writer.nodeToString(firstChild);
                }
                axisService.setServiceDescription(serviceDes);
            }

I added a null check for firstchild as well

 if ((documentationElement != null) && (documentationElement.getFirstChild() != null))
{
                Node firstChild = documentationElement.getFirstChild();
                String serviceDes;
                if (firstChild.getNodeType() == Node.TEXT_NODE) {
                    serviceDes = firstChild.getNodeValue();
                } else {
                    serviceDes = DOM2Writer.nodeToString(firstChild);
                }
                axisService.setServiceDescription(serviceDes);
            }

Any way why you want to have an empty documentaion element?

> Null pointer exception when using the WSDL2Java tool
> ----------------------------------------------------
>
>                 Key: AXIS2-1851
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1851
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl, codegen
>    Affects Versions: 1.1
>         Environment: Windows XP, IBM IntelliStation Z Pro
>            Reporter: Piers Coleman
>            Priority: Blocker
>         Attachments: axis2_kernal_patch.txt, ContactTypes.xsd, EmployerInfoRequest.xsd,
EmployerInfoResponse.xsd
>
>
> I'm trying to use the WSDL2Java tool to generate my server-side skeleton code. The
> results are below. The WSDL file imports the XSD files that it uses. I've included the
WSDL at the end as well
> The WSDL was validated using the interoperability tool from WS-I:
> http://www.ws-i.org/deliverables/workinggroup.aspx?wg=testingtools. I
> plugged this tool into SoapUI and everything passed ok.
> The WSDL was validated using the latest version of XMLSpy.
> Let me know if you would also like the imported xsd files.
> C:\WCA\PocWebService\Types>WSDL2Java.bat -uri PocService.wsdl -ss -sd
> -d xmlbean s -o ..\out -p services.pocservice
> Using AXIS2_HOME:   C:\axis2-1.1
> Using JAVA_HOME:    C:\j2sdk1.4.2_13
> Retrieving schema at 'EmployerInfoResponse.xsd', relative to
> 'file:/C:/WCA/PocWebService/Types/'.
> Retrieving schema at 'ContactTypes.xsd', relative to
> file:/C:/WCA/PocWebService
> /Types/EmployerInfoResponse.xsd'.
> Retrieving schema at 'EmployerInfoException.xsd', relative to
> 'file:/C:/WCA/PocW
> ebService/Types/'.
> Retrieving schema at 'EmployerInfoRequest.xsd', relative to
> 'file:/C:/WCA/PocWeb
> Service/Types/'.
> Dec 7, 2006 5:01:50 PM
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder p
> opulateService
> SEVERE: java.lang.NullPointerException
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException
> : Error parsing WSDL
> at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
> ionEngine.java:112)
> at
> org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> at
> org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: org.apache.axis2.AxisFault: null; nested exception is:
>         java.lang.NullPointerException
> at
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
> ce(WSDL11ToAxisServiceBuilder.java:250)
>         at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
> ionEngine.java:103)
>         ... 2 more
> Caused by: java.lang.NullPointerException
>         at
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
> ce(WSDL11ToAxisServiceBuilder.java:235)
>          ... 3 more
> <definitions xmlns:tns="urn:wsbc.com:webportal:services:pocservice" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:import1="urn:wsbc.com:webportal:messages"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" name="PocService"
targetNamespace="urn:wsbc.com:webportal:services:pocservice">
> 	<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
> 	<types>
> 		<xsd:schema>
> 			<xsd:import schemaLocation="EmployerInfoResponse.xsd" namespace="urn:wsbc.com:webportal:messages"/>
> 			<xsd:import schemaLocation="EmployerInfoException.xsd" namespace="urn:wsbc.com:webportal:messages"/>
> 			<xsd:import schemaLocation="EmployerInfoRequest.xsd" namespace="urn:wsbc.com:webportal:messages"/>
> 		</xsd:schema>
> 	</types>
> 	<message name="getEmployerInfoIn">
> 		<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
> 		<part name="messagePart" element="import1:GetEmployerInfo"/>
> 	</message>
> 	<message name="getEmployerInfoOut">
> 		<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
> 		<part name="messagePart" element="import1:GetEmployerInfoResponse"/>
> 	</message>
> 	<message name="employerInfoProcessingFaultIn">
> 		<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
> 		<part name="messagePart" element="import1:EmployerInfoProcessingFault"/>
> 	</message>
> 	<portType name="PocServiceInterface">
> 		<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
> 		<operation name="GetEmployerInfo">
> 			<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
> 			<input message="tns:getEmployerInfoIn"/>
> 			<output message="tns:getEmployerInfoOut"/>
> 			<fault name="EmployerInfoProcessingException" message="tns:employerInfoProcessingFaultIn"/>
> 		</operation>
> 	</portType>
> 	<binding name="PocService" type="tns:PocServiceInterface">
> 		<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<operation name="GetEmployerInfo">
> 			<soap:operation soapAction="urn:wsbc.com:webportal:services:pocservice:getEmployerInfoIn"
style="document"/>
> 			<input>
> 				<soap:body use="literal"/>
> 			</input>
> 			<output>
> 				<soap:body use="literal"/>
> 			</output>
> 			<fault name="EmployerInfoProcessingException">
> 				<soap:fault name="EmployerInfoProcessingException" use="literal"/>
> 			</fault>
> 		</operation>
> 	</binding>
> 	<service name="PocServicePort">
> 		<port name="PocServicePort" binding="tns:PocService">
> 			<soap:address location="http://localhost:9080/axis2/pocwebservice"/>
> 		</port>
> 	</service>
> </definitions>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message