DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15669>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15669

W2DL2Java - NullPointerException if PortType for Port is missing

           Summary: W2DL2Java - NullPointerException if PortType for Port is
                    missing
           Product: Axis
           Version: current (nightly)
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: WSDL processing
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


****************************************
***  Exception
****************************************

java.lang.NullPointerException
        at org.apache.axis.wsdl.symbolTable.SymbolTable.setServiceReferences
(SymbolTable.java:2123)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.setReferences
(SymbolTable.java:1865)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.add
(SymbolTable.java:387)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate
(SymbolTable.java:371)
        at org.apache.axis.wsdl.symbolTable.SymbolTable.populate
(SymbolTable.java:356)
        at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
        at java.lang.Thread.run(Thread.java:536)


****************************************
****  Input
****************************************

<?xml version="1.0" encoding="UTF-8"?>
<definitions
  xmlns="http://schemas.xmlsoap.org/wsdl/";
  targetNamespace="urn:foo.bar"
  xmlns:tns="urn:foo.bar"
  xmlns:xsd="http://www.w3.org/2000/10/XMLSchema";>
>
        <message name="req">
                <part name="body" type="xsd:string" />
        </message>
                
        <message name="resp">
                <part name="body" type="xsd:float" />
        </message>
        
        
        
        <portType name="ptTemperature">
                <operation name="GetTemperature">
                        <input message="req" />
                        <output message="resp" />               
                </operation>    
        </portType>
        
        <!-- 
          NOTE: no port type defined for port 'WeatherForecast' 
        -->
        <service name="WeatherForecast">
                <port name="WeatherForecast">                   
                </port> 
        </service>
</definitions>



****************************************
*** Patch
****************************************

Here's patch  which solves the problem: 


Index: SymbolTable.java
===================================================================
RCS file: /home/cvspublic/xml-
axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
retrieving revision 1.61
diff -r1.61 SymbolTable.java
2118,2120c2118,2122
<             BindingEntry bEntry = getBindingEntry(binding.getQName());
<             if (bEntry != null) {
<                 setBindingReferences(bEntry, def, doc);
---
>             if (binding != null) {
>                   BindingEntry bEntry = getBindingEntry(binding.getQName());
>                   if (bEntry != null) {
>                       setBindingReferences(bEntry, def, doc);
>                   }

Reply via email to