[
http://jira.jboss.com/jira/browse/JBWS-1174?page=comments#action_12347325 ]
Manuel Valladares commented on JBWS-1174:
-----------------------------------------
I found that the error is in lines like this:
<xs:extension base="StringLength0to128">
If I change the type from StringLength0to128 to xs:string and now it passes the error.
The new lines are like this:
<xs:extension base="xs:string">
The StringLength0to128 is a type defined by the OTA specification as:
<xs:simpleType name="StringLength0to128">
<xs:annotation>
<xs:documentation xml:lang="en">Used for Character Strings, length 0
to 128</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="128"/>
</xs:restriction>
</xs:simpleType>
NullPointerException using wstools to generate java classes from
WSDL
---------------------------------------------------------------------
Key: JBWS-1174
URL:
http://jira.jboss.com/jira/browse/JBWS-1174
Project: JBoss Web Services
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: wstools
Affects Versions: jbossws-1.0.3
Environment: openSuse 10.1
jdk 1.5.0_06-b5
jbossws-1.0.3
jboss-4.0.4.GA
Reporter: Manuel Valladares
Fix For: jbossws-2.1.0
Attachments: files.ZIP
I have a wsdl file that imports several schema files.
When I use wstools to generate the client classes the program returns a
NullPointerException.
The schema files are part of the OTA specification and they should be valid.
With axis 1.2.1 and using wsdl2java everything works fine.
I am including the wsdl file, I would like to add the schema files but there isn't a
place where to attach files.
Here it is the the output of the exception:
Exception in thread "main" java.lang.NullPointerException
at org.jboss.ws.tools.XSDTypeToJava.getVARList(XSDTypeToJava.java:214)
at org.jboss.ws.tools.XSDTypeToJava.createJavaFile(XSDTypeToJava.java:154)
at
org.jboss.ws.tools.XSDTypeToJava.createVARforXSElementDeclaration(XSDTypeToJava.java:628)
at
org.jboss.ws.tools.XSDTypeToJava.createVARsForElements(XSDTypeToJava.java:519)
at
org.jboss.ws.tools.XSDTypeToJava.createVARsforXSParticle(XSDTypeToJava.java:446)
at org.jboss.ws.tools.XSDTypeToJava.getVARList(XSDTypeToJava.java:249)
at org.jboss.ws.tools.XSDTypeToJava.createJavaFile(XSDTypeToJava.java:154)
at org.jboss.ws.tools.XSDTypeToJava.createJavaFile(XSDTypeToJava.java:149)
at
org.jboss.ws.tools.XSDTypeToJava.createVARforXSElementDeclaration(XSDTypeToJava.java:587)
at
org.jboss.ws.tools.XSDTypeToJava.createVARsForElements(XSDTypeToJava.java:519)
at
org.jboss.ws.tools.XSDTypeToJava.createVARsforXSParticle(XSDTypeToJava.java:446)
at org.jboss.ws.tools.XSDTypeToJava.getVARList(XSDTypeToJava.java:249)
at org.jboss.ws.tools.XSDTypeToJava.createJavaFile(XSDTypeToJava.java:154)
at
org.jboss.ws.tools.XSDTypeToJava.createVARforXSElementDeclaration(XSDTypeToJava.java:628)
at
org.jboss.ws.tools.XSDTypeToJava.createVARsForElements(XSDTypeToJava.java:519)
at
org.jboss.ws.tools.XSDTypeToJava.createVARsforXSParticle(XSDTypeToJava.java:446)
at org.jboss.ws.tools.XSDTypeToJava.getVARList(XSDTypeToJava.java:249)
at org.jboss.ws.tools.XSDTypeToJava.createJavaFile(XSDTypeToJava.java:154)
at org.jboss.ws.tools.XSDTypeToJava.createJavaFile(XSDTypeToJava.java:114)
at org.jboss.ws.tools.WSDLToJava.generateJavaSource(WSDLToJava.java:701)
at org.jboss.ws.tools.WSDLToJava.generateJavaSource(WSDLToJava.java:694)
at org.jboss.ws.tools.WSDLToJava.getReturnType(WSDLToJava.java:575)
at org.jboss.ws.tools.WSDLToJava.appendMethods(WSDLToJava.java:372)
at org.jboss.ws.tools.WSDLToJava.createSEIFile(WSDLToJava.java:512)
at org.jboss.ws.tools.WSDLToJava.createSEI(WSDLToJava.java:534)
at org.jboss.ws.tools.WSDLToJava.generateSEI(WSDLToJava.java:188)
at
org.jboss.ws.tools.helpers.ToolsHelper.handleWSDLToJavaGeneration(ToolsHelper.java:329)
at org.jboss.ws.tools.WSTools.process(WSTools.java:138)
at org.jboss.ws.tools.WSTools.generate(WSTools.java:120)
at org.jboss.ws.tools.WSTools.main(WSTools.java:61)
Here is my wsdl file:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="OTA_HotelAvail"
targetNamespace="http://xmlns.oracle.com/OTA_HotelAvail"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://xmlns.oracle.com/OTA_HotelAvail"
xmlns:ns1="http://www.opentravel.org/OTA/2003/05"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:ns2="http://www.example.org"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:client="http://xmlns.oracle.com/OTA_HotelAvail">
<types>
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:client="http://xmlns.oracle.com/OTA_HotelAvail"
xmlns:ns1="http://www.opentravel.org/OTA/2003/05"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"...
<import
namespace="http://www.opentravel.org/OTA/2003/05"
schemaLocation="xsd/OTA_HotelAvailRQ.xsd"/>
</schema>
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:client="http://xmlns.oracle.com/OTA_HotelAvail"
xmlns:ns1="http://www.opentravel.org/OTA/2003/05"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"...
<import
namespace="http://www.opentravel.org/OTA/2003/05"
schemaLocation="xsd/OTA_HotelAvailRS.xsd"/>
</schema>
</types>
<message name="OTA_HotelAvailRequestMessage">
<part name="payload" element="ns1:OTA_HotelAvailRQ"/>
</message>
<message name="OTA_HotelAvailResponseMessage">
<part name="payload" element="ns1:OTA_HotelAvailRS"/>
</message>
<portType name="OTA_HotelAvail">
<operation name="process">
<input message="tns:OTA_HotelAvailRequestMessage"/>
<output message="tns:OTA_HotelAvailResponseMessage"/>
</operation>
</portType>
<binding name="OTA_HotelAvailBinding"
type="tns:OTA_HotelAvail">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="process">
<soap:operation style="document"
soapAction="process"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="OTA_HotelAvail">
<port name="OTA_HotelAvailPort"
binding="tns:OTA_HotelAvailBinding">
<soap:address
location="http://pruebaoracle.oracle.com:7778/orabpel/Clientes/OTA_HotelAvail/1.0"/>
</port>
</service>
<plnk:partnerLinkType name="OTA_HotelAvail">
<plnk:role name="OTA_HotelAvailProvider">
<plnk:portType name="tns:OTA_HotelAvail"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira