[ 
https://issues.apache.org/jira/browse/CAMEL-6716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13994301#comment-13994301
 ] 

ASF GitHub Bot commented on CAMEL-6716:
---------------------------------------

GitHub user ancosen opened a pull request:

    https://github.com/apache/camel/pull/147

    [CAMEL-6716] ServiceInterfaceStrategy fails to create with interface 
containing multiple methods without parameters

    Hi all,
    
    This pull requeste is related to:
    https://issues.apache.org/jira/browse/CAMEL-6716
    
    I've added a second method without parameter in the customerservice.wsdl 
and add an assert in the **testServiceInterfaceStrategyWithClient** method of 
**ServiceInterfaceStrategyTest** Test class.
    
    Hope this should be useful and it will be merged.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ancosen/camel 
camel-6716-serviceinterfacestrategyfix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/147.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #147
    
----
commit 7b96bde38f16b4c42af543d9a3d4b94913af26f3
Author: ancosen <[email protected]>
Date:   2014-05-09T10:06:02Z

    Added new Properties Component Test related to concatenation of properties. 
First test fails because of unsupported parsing properties.

commit 8fe696c02738baaf4d299a01386a4018c1e0c6e4
Author: ancosen <[email protected]>
Date:   2014-05-09T10:14:56Z

    Reload Pom.xml

commit 6e59877da99ef208e699284c05221f0c318e1c33
Author: ancosen <[email protected]>
Date:   2014-05-10T15:48:13Z

    Fixes Camel-6716: ServiceInterfaceStrategy fails to create with interface 
containing multiple methods without parameters

commit d551e36d0c484d6e8603fda73da0d08aea7618e3
Author: ancosen <[email protected]>
Date:   2014-05-10T20:06:34Z

    Fixes 6716: ServiceInterfaceStrategy fails to create with interface 
containing multiple methods without parameters

----


> ServiceInterfaceStrategy fails to create with interface containing multiple 
> methods without parameters
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-6716
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6716
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-soap
>    Affects Versions: 2.12.0
>            Reporter: Ondrej Fischer
>            Priority: Minor
>             Fix For: Future
>
>
> I you attempt to create a ServiceInterfaceStrategy with interface containing 
> multiple methods without parameters, you get NullPointerException.
> It's due to following code:
> ServiceInterfaceStrategy.java:161
> {code}
> 155    private void analyzeServiceInterface(Class<?> serviceInterface) {
> 156        Method[] methods = serviceInterface.getMethods();
> 157        for (Method method : methods) {
> 158            MethodInfo info = analyzeMethod(method);
> 159            for (int i = 0; i < info.getIn().length; i++) {
> 160                TypeInfo ti = info.getIn()[i];
> 161                if (inTypeNameToQName.containsKey(ti.getTypeName())
> 162                    && (!(ti.getTypeName().equals("javax.xml.ws.Holder")))
> 163                    && 
> (!(inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))) {
> 164                    LOG.warn("Ambiguous QName mapping. The type [ "
> 165                                                    + ti.getTypeName()
> 166                                                    + " ] is already 
> mapped to a QName in this context.");
> 167                    continue;
> 168                }
> 169                inTypeNameToQName.put(ti.getTypeName(), ti.getElName());
> 170            }
> 171            if (info.getSoapAction() != null && 
> !"".equals172(info.getSoapAction())) {
> 172                soapActionToMethodInfo.put(info.getSoapAction(), info);
> 173            }
> 174
> 175            outTypeNameToQName.put(info.getOut().getTypeName(), 
> info.getOut().getElName());
> 176
> 177            addExceptions(method);
> 178        }
> 179    }
> {code}
> For the second method without parameters, the null value is already in the 
> inTypeNameToQName, so it tries to evaluate this: 
> !(ti.getTypeName().equals("javax.xml.ws.Holder"), which fails with NPE.
> The question here is, why method without parameters still needs an array of 
> types containing one element with those null values.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to