[ 
https://issues.apache.org/jira/browse/AXIS2-3356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544168
 ] 

Keith Godwin Chapman commented on AXIS2-3356:
---------------------------------------------

Hi Sean,

There is a problem in your WSDL. The following is the interface in your WSDL,

    <interface name="TmsInterface">                                             
    
                <operation name="rate"
                                pattern="http://www.w3.org/ns/wsdl/in-out"; 
                    style="http://www.w3.org/ns/wsdl/style/iri";
                wsdlx:safe = "true">

                                <input messageLabel="In" 
                              element="rating:TmsRateRequest" />
                        <output messageLabel="Out" 
                              element="rating:TmsRateResponse" />
                        <outfault ref="tns:invalidDataFault" 
messageLabel="Out"/>
                </operation>
    </interface>

Note that in the outfault of your operation you refer to tns:invalidDataFault 
which you havent defined. This causes the null pointer (I will add a null check 
to the Axis2 code so that it fails gracefully.). You are missing the 
declaration of the fault in your WSDL. Adding the following to the interface 
should solve your problem (update it to the correct fault element)

<fault name="invalidDataFault" element="rating:invalidDataFault">
      <documentation>Your fault declaration</documentation>
 </fault>

So you should have an interface such as,

    <interface name="TmsInterface">  
                <fault name="invalidDataFault" 
element="rating:invalidDataFault">
                      <documentation>Your fault declaration</documentation>
                </fault>                                               
                <operation name="rate"
                                pattern="http://www.w3.org/ns/wsdl/in-out"; 
                    style="http://www.w3.org/ns/wsdl/style/iri";
                wsdlx:safe = "true">

                                <input messageLabel="In" 
                              element="rating:TmsRateRequest" />
                        <output messageLabel="Out" 
                              element="rating:TmsRateResponse" />
                        <outfault ref="tns:invalidDataFault" 
messageLabel="Out"/>
                </operation>
    </interface>

Thanks,
Keith

> NullPointerException in  WSDL20ToAxisServiceBuilder
> ---------------------------------------------------
>
>                 Key: AXIS2-3356
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3356
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.3
>         Environment: Sun JDK 1.5.0_13
>            Reporter: Sean Sullivan
>            Assignee: Keith Godwin Chapman
>         Attachments: Main.java, TmsServices-b.wsdl, TmsServices.wsdl
>
>
> I am using Apache Axis 2 version 1.3 and JDK 1.5.0_13 
> When I run wsdl2java, I encounter a NullPointerException in 
> WSDL20ToAxisServiceBuilder.
> The WSDL file is WSDL 2.0  (not WSDL 1.1).   I'll attach the WSDL file to 
> this bug report.
> wsdl2java -ss -wv 2.0 -p com.mycorp.foo -o src -uri 
> .\webservices\TmsServices.wsdl
> Using AXIS2_HOME:   c:\axis2-1.3
> Using JAVA_HOME:    C:\Progra~1\Java\jdk1.5.0_13
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException
> : Error parsing WSDL
>         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.WSDL2Java.main(WSDL2Java.java:24)
> Caused by: org.apache.axis2.AxisFault
>         at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
>         at
> org.apache.axis2.description.WSDL20ToAxisServiceBuilder.populateServi
> ce(WSDL20ToAxisServiceBuilder.java:236)
>         at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
> ionEngine.java:101)
>         ... 2 more
> Caused by: java.lang.NullPointerException
>         at
> org.apache.axis2.description.WSDL20ToAxisServiceBuilder.createAxisMes
> sage(WSDL20ToAxisServiceBuilder.java:976)
>         at
> org.apache.axis2.description.WSDL20ToAxisServiceBuilder.populateOpera
> tions(WSDL20ToAxisServiceBuilder.java:926)
>         at
> org.apache.axis2.description.WSDL20ToAxisServiceBuilder.processInterf
> ace(WSDL20ToAxisServiceBuilder.java:849)
>         at
> org.apache.axis2.description.WSDL20ToAxisServiceBuilder.processServic
> e(WSDL20ToAxisServiceBuilder.java:306)
>         at
> org.apache.axis2.description.WSDL20ToAxisServiceBuilder.populateServi
> ce(WSDL20ToAxisServiceBuilder.java:233)
>         ... 3 more

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to