codegen use wsdl2c throw null exception when operation has only output 
-----------------------------------------------------------------------

                 Key: AXIS2C-1386
                 URL: https://issues.apache.org/jira/browse/AXIS2C-1386
             Project: Axis2-C
          Issue Type: Bug
          Components: code generation
    Affects Versions: 1.6.0
         Environment: winxp, axis2c 1.6.0
            Reporter: tomi stdanley


D:\obsystem\rel\bin>axis2-1.5\bin\wsdl2c.bat -uri outbound.wsdl -ss -sd -d adb 
-u
Using AXIS2_HOME:   D:\obsystem\rel\bin\axis2-1.5
Using JAVA_HOME:    C:\Program Files\Java\jre1.6.0
Retrieving document at 'outbound.wsdl'.
[ERROR]
java.lang.NullPointerException
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateOpera
tions(WSDL11ToAxisServiceBuilder.java:1340)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populatePortT
ype(WSDL11ToAxisServiceBuilder.java:591)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
ints(WSDL11ToAxisServiceBuilder.java:468)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:362)
        at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
llServices(WSDL11ToAllAxisServicesBuilder.java:107)
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:147)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
        at org.apache.axis2.wsdl.WSDL2C.main(WSDL2C.java:31)
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
: Error parsing WSDL
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:153)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
        at org.apache.axis2.wsdl.WSDL2C.main(WSDL2C.java:31)
Caused by: org.apache.axis2.AxisFault
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:396)
        at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
llServices(WSDL11ToAllAxisServicesBuilder.java:107)
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:147)
        ... 2 more
Caused by: java.lang.NullPointerException
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateOpera
tions(WSDL11ToAxisServiceBuilder.java:1340)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populatePortT
ype(WSDL11ToAxisServiceBuilder.java:591)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
ints(WSDL11ToAxisServiceBuilder.java:468)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:362)
        ... 4 more
D:\obsystem\rel\bin>axis2-1.5\bin\wsdl2c.bat -uri t2.wsdl -ss -sd -d adb -u
Using AXIS2_HOME:   D:\obsystem\rel\bin\axis2-1.5
Using JAVA_HOME:    C:\Program Files\Java\jre1.6.0
Retrieving document at 't2.wsdl'.
[ERROR] No binding input is defiend for binding operation ==> staff_getplan
org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException:
 No binding input is defiend for binding operation ==> staff_getplan
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.createSchemaF
orPorttype(WSDL11ToAxisServiceBuilder.java:1646)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.generateWrapp
erSchema(WSDL11ToAxisServiceBuilder.java:1487)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:344)
        at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
llServices(WSDL11ToAllAxisServicesBuilder.java:107)
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:147)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
        at org.apache.axis2.wsdl.WSDL2C.main(WSDL2C.java:31)
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
: Error parsing WSDL
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:153)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
        at org.apache.axis2.wsdl.WSDL2C.main(WSDL2C.java:31)
Caused by: org.apache.axis2.AxisFault: No binding input is defiend for binding o
peration ==> staff_getplan
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:396)
        at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
llServices(WSDL11ToAllAxisServicesBuilder.java:107)
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:147)
        ... 2 more
Caused by: org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessin
gException: No binding input is defiend for binding operation ==> staff_getplan
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.createSchemaF
orPorttype(WSDL11ToAxisServiceBuilder.java:1646)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.generateWrapp
erSchema(WSDL11ToAxisServiceBuilder.java:1487)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:344)
        ... 4 more
D:\obsystem\rel\bin>axis2-1.5\bin\wsdl2c.bat -uri t2.wsdl -ss -sd -d adb -u
Using AXIS2_HOME:   D:\obsystem\rel\bin\axis2-1.5
Using JAVA_HOME:    C:\Program Files\Java\jre1.6.0
Retrieving document at 't2.wsdl'.
[ERROR]
java.lang.NullPointerException
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateOpera
tions(WSDL11ToAxisServiceBuilder.java:1340)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populatePortT
ype(WSDL11ToAxisServiceBuilder.java:591)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
ints(WSDL11ToAxisServiceBuilder.java:468)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:362)
        at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
llServices(WSDL11ToAllAxisServicesBuilder.java:107)
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:147)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
        at org.apache.axis2.wsdl.WSDL2C.main(WSDL2C.java:31)
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
: Error parsing WSDL
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:153)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
        at org.apache.axis2.wsdl.WSDL2C.main(WSDL2C.java:31)
Caused by: org.apache.axis2.AxisFault
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:396)
        at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
llServices(WSDL11ToAllAxisServicesBuilder.java:107)
        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
ionEngine.java:147)
        ... 2 more
Caused by: java.lang.NullPointerException
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateOpera
tions(WSDL11ToAxisServiceBuilder.java:1340)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populatePortT
ype(WSDL11ToAxisServiceBuilder.java:591)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
ints(WSDL11ToAxisServiceBuilder.java:468)
        at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
ce(WSDL11ToAxisServiceBuilder.java:362)
        ... 4 more
D:\obsystem\rel\bin>

=======================
following is the wsdl file
=======================

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
        targetNamespace="http://www.asiainfo.com/obd/t2.obd";
  xmlns:obd="http://www.asiainfo.com/obd/common";
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
        xmlns:MOutBoun="http://www.asiainfo.com/obd/t2.obd";
         >
        <wsdl:types>
                <xsd:schema targetNamespace="http://www.asiainfo.com/obd/t2.obd";
                xmlns="http://www.w3.org/2001/XMLSchema";
                elementFormDefault="qualified" 
attributeFormDefault="unqualified">
        
  <complexType name="SCond">
    <sequence>
      <element name="staffId" type="xsd:int" minOccurs="0"/>
      <element name="name" type="xsd:string" minOccurs="0"/>
    </sequence>
  </complexType>
  <complexType name="SCondList">
    <annotation>list type</annotation>
    <sequence>
      <element name="SCondList_Item" type="MOutBoun:SCond" minOccurs="0" 
maxOccurs="unbounded"/>
    </sequence>
  </complexType>
  <complexType name="SAttendPlan">
    <sequence>
      <element name="planId" type="xsd:int" minOccurs="0"/>
      <element name="planName" type="xsd:string" minOccurs="0"/>
      <element name="priority" type="xsd:int" minOccurs="0"/>
      <element name="totalNum" type="xsd:int" minOccurs="0"/>
      <element name="finishedNum" type="xsd:int" minOccurs="0"/>
      <element name="assignedNum" type="xsd:int" minOccurs="0"/>
      <element name="unmallocNum" type="xsd:int" minOccurs="0"/>
      <element name="tmpSaved" type="xsd:int" minOccurs="0"/>
    </sequence>
  </complexType>
  <complexType name="SAttendPlanList">
    <annotation>list type</annotation>
    <sequence>
      <element name="SAttendPlanList_Item" type="MOutBoun:SAttendPlan" 
minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </complexType>
        </xsd:schema>   
        </wsdl:types>
                <wsdl:message name="staff_getplan_pOut">
                <wsdl:part name="listPlan" type="MOutBoun:SAttendPlanList"/> 
                </wsdl:message> 
        <wsdl:portType name="Intf">
                <wsdl:operation name="staff_getplan">
                        
                        <wsdl:output message="MOutBoun:staff_getplan_pOut"  
name="staff_getplanResp"/>
                </wsdl:operation>
        </wsdl:portType>
<wsdl:binding name="IOutBoun" type="MOutBoun:Intf">
        <soap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>

                <wsdl:operation name="staff_getplan">
                <soap:operation style="rpc" 
soapAction="/MOutBoun/IOutBoun/staff_getplan"/>
        <wsdl:output >
                        <soap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";  parts="listPlan "/>
                </wsdl:output >
                </wsdl:operation>
</wsdl:binding>
        <wsdl:service name="IOutBounService">
                <wsdl:port name="PortType" binding="MOutBoun:IOutBoun">
      <soap:address location="http://www.asiainfo.com/MOutBoun/IOutBoun"/>
    </wsdl:port>
        </wsdl:service>
</wsdl:definitions>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to