You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Glen Mazza (JIRA)" <ji...@apache.org> on 2007/10/25 13:24:51 UTC

[jira] Created: (CXF-1137) CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding

CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding
------------------------------------------------------------------------------------

                 Key: CXF-1137
                 URL: https://issues.apache.org/jira/browse/CXF-1137
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.0.2
            Reporter: Glen Mazza


If a user accidentally gives a wrong portType name in the wsdl:binding section, wsdl2java returns a NullPointerException without giving the user any feedback why.  For example, for this portType:

   <wsdl:portType name="HelloWorldPortType">
             .....
   </wsdl:portType>

The name should be tns:HelloWorldPortType in the binding:

   <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorldPortType">
             .....
   </wsdl:binding>

But if the user accidentally has this in the WSDL:

   <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">  (wrong type given)
             .....
   </wsdl:binding>

wsdl2java will return an NPE without any feedback about what the problem is.

GlassFish Metro correctly returns a user-friendly error message under these circumstances:
wsdl:portType "{http://company.hw.demo/}HelloWorld" not found in the wsdl: file:/blah/blah/blah/helloWorld.wsdl


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


[jira] Assigned: (CXF-1137) CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding

Posted by "maomaode (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

maomaode reassigned CXF-1137:
-----------------------------

    Assignee: maomaode

> CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-1137
>                 URL: https://issues.apache.org/jira/browse/CXF-1137
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>            Reporter: Glen Mazza
>            Assignee: maomaode
>         Attachments: helloWorld.wsdl
>
>
> If a user accidentally gives a wrong portType name in the wsdl:binding section, wsdl2java returns a NullPointerException without giving the user any feedback why.  For example, for this portType:
>    <wsdl:portType name="HelloWorldPortType">
>              .....
>    </wsdl:portType>
> The name should be tns:HelloWorldPortType in the binding:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorldPortType">
>              .....
>    </wsdl:binding>
> But if the user accidentally has this in the WSDL:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">  (wrong type given)
>              .....
>    </wsdl:binding>
> wsdl2java will return an NPE without any feedback about what the problem is.
> GlassFish Metro correctly returns a user-friendly error message under these circumstances:
> wsdl:portType "{http://company.hw.demo/}HelloWorld" not found in the wsdl: file:/blah/blah/blah/helloWorld.wsdl

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


[jira] Commented: (CXF-1137) CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding

Posted by "maomaode (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537800 ] 

maomaode commented on CXF-1137:
-------------------------------

Well, the exception actually is from the WSDLServiceBuilder.java in the rt/core,  

If you turn on the -validation, tools do give you the error msg, but by default we turn off the validation during wsdl definition build, 
There's couple rules opened by default during the wsdl service build.

I guess to fix this issue, the best option is turn on the validation by default, and fix all the wrong wsdls in the cxf tests, but it's a big task

> CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-1137
>                 URL: https://issues.apache.org/jira/browse/CXF-1137
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>            Reporter: Glen Mazza
>            Assignee: maomaode
>         Attachments: helloWorld.wsdl
>
>
> If a user accidentally gives a wrong portType name in the wsdl:binding section, wsdl2java returns a NullPointerException without giving the user any feedback why.  For example, for this portType:
>    <wsdl:portType name="HelloWorldPortType">
>              .....
>    </wsdl:portType>
> The name should be tns:HelloWorldPortType in the binding:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorldPortType">
>              .....
>    </wsdl:binding>
> But if the user accidentally has this in the WSDL:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">  (wrong type given)
>              .....
>    </wsdl:binding>
> wsdl2java will return an NPE without any feedback about what the problem is.
> GlassFish Metro correctly returns a user-friendly error message under these circumstances:
> wsdl:portType "{http://company.hw.demo/}HelloWorld" not found in the wsdl: file:/blah/blah/blah/helloWorld.wsdl

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


[jira] Updated: (CXF-1137) CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding

Posted by "Glen Mazza (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Glen Mazza updated CXF-1137:
----------------------------

    Attachment: helloWorld.wsdl

WSDL that demonstrates the problem.
Can be activated simply via "wsdl2java helloWorld.wsdl"


> CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-1137
>                 URL: https://issues.apache.org/jira/browse/CXF-1137
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>            Reporter: Glen Mazza
>         Attachments: helloWorld.wsdl
>
>
> If a user accidentally gives a wrong portType name in the wsdl:binding section, wsdl2java returns a NullPointerException without giving the user any feedback why.  For example, for this portType:
>    <wsdl:portType name="HelloWorldPortType">
>              .....
>    </wsdl:portType>
> The name should be tns:HelloWorldPortType in the binding:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorldPortType">
>              .....
>    </wsdl:binding>
> But if the user accidentally has this in the WSDL:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">  (wrong type given)
>              .....
>    </wsdl:binding>
> wsdl2java will return an NPE without any feedback about what the problem is.
> GlassFish Metro correctly returns a user-friendly error message under these circumstances:
> wsdl:portType "{http://company.hw.demo/}HelloWorld" not found in the wsdl: file:/blah/blah/blah/helloWorld.wsdl

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


[jira] Commented: (CXF-1137) CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding

Posted by "Glen Mazza (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538153 ] 

Glen Mazza commented on CXF-1137:
---------------------------------

I can help with the bad WSDL's.  But actually, this NPE should not occur even if validation is turned off.  Can it just return a user-friendly error instead, not just an NPE?  It does not--nor should not--be as elaborate as the validation error message.  It should just say "PortType reference not found" or similar.

As for validation, in the future, I see two types of validation:
1.)  WSDL errors or BP-I violations that CXF cannot work properly with.  This should always be turned on.  For example, the same request body issue (#3 of my notes here:  http://www.jroller.com/gmazza/date/20071019#notes) -- CXF wrongly calls the first operation even though the second may be intended.

2.)  Those BP-I violations that CXF can still handle correctly anyway.  This probably should be optional, turned off by default.

I think what is needed is that each of our validation tests have an internal "requiredTest" flag that wsdl2java activates if this value is "true".  WDYT?--How difficult would this be?

Glen


> CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-1137
>                 URL: https://issues.apache.org/jira/browse/CXF-1137
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>            Reporter: Glen Mazza
>            Assignee: maomaode
>         Attachments: helloWorld.wsdl
>
>
> If a user accidentally gives a wrong portType name in the wsdl:binding section, wsdl2java returns a NullPointerException without giving the user any feedback why.  For example, for this portType:
>    <wsdl:portType name="HelloWorldPortType">
>              .....
>    </wsdl:portType>
> The name should be tns:HelloWorldPortType in the binding:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorldPortType">
>              .....
>    </wsdl:binding>
> But if the user accidentally has this in the WSDL:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">  (wrong type given)
>              .....
>    </wsdl:binding>
> wsdl2java will return an NPE without any feedback about what the problem is.
> GlassFish Metro correctly returns a user-friendly error message under these circumstances:
> wsdl:portType "{http://company.hw.demo/}HelloWorld" not found in the wsdl: file:/blah/blah/blah/helloWorld.wsdl

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


[jira] Updated: (CXF-1137) CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding

Posted by "maomaode (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

maomaode updated CXF-1137:
--------------------------

    Fix Version/s: 2.0.3

> CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-1137
>                 URL: https://issues.apache.org/jira/browse/CXF-1137
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>            Reporter: Glen Mazza
>            Assignee: maomaode
>             Fix For: 2.0.3
>
>         Attachments: helloWorld.wsdl
>
>
> If a user accidentally gives a wrong portType name in the wsdl:binding section, wsdl2java returns a NullPointerException without giving the user any feedback why.  For example, for this portType:
>    <wsdl:portType name="HelloWorldPortType">
>              .....
>    </wsdl:portType>
> The name should be tns:HelloWorldPortType in the binding:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorldPortType">
>              .....
>    </wsdl:binding>
> But if the user accidentally has this in the WSDL:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">  (wrong type given)
>              .....
>    </wsdl:binding>
> wsdl2java will return an NPE without any feedback about what the problem is.
> GlassFish Metro correctly returns a user-friendly error message under these circumstances:
> wsdl:portType "{http://company.hw.demo/}HelloWorld" not found in the wsdl: file:/blah/blah/blah/helloWorld.wsdl

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


[jira] Resolved: (CXF-1137) CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding

Posted by "maomaode (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

maomaode resolved CXF-1137.
---------------------------

    Resolution: Fixed

> CXF wsdl2java NPE's if it cannot find the wsdl:portType identified by a wsdl:binding
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-1137
>                 URL: https://issues.apache.org/jira/browse/CXF-1137
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>            Reporter: Glen Mazza
>            Assignee: maomaode
>         Attachments: helloWorld.wsdl
>
>
> If a user accidentally gives a wrong portType name in the wsdl:binding section, wsdl2java returns a NullPointerException without giving the user any feedback why.  For example, for this portType:
>    <wsdl:portType name="HelloWorldPortType">
>              .....
>    </wsdl:portType>
> The name should be tns:HelloWorldPortType in the binding:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorldPortType">
>              .....
>    </wsdl:binding>
> But if the user accidentally has this in the WSDL:
>    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">  (wrong type given)
>              .....
>    </wsdl:binding>
> wsdl2java will return an NPE without any feedback about what the problem is.
> GlassFish Metro correctly returns a user-friendly error message under these circumstances:
> wsdl:portType "{http://company.hw.demo/}HelloWorld" not found in the wsdl: file:/blah/blah/blah/helloWorld.wsdl

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