You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Richard Opalka (JIRA)" <ji...@apache.org> on 2008/06/02 16:19:45 UTC

[jira] Created: (CXF-1623) Wrong method implementation in AnnotationHandlerChainBuilder

Wrong method implementation in AnnotationHandlerChainBuilder
------------------------------------------------------------

                 Key: CXF-1623
                 URL: https://issues.apache.org/jira/browse/CXF-1623
             Project: CXF
          Issue Type: Sub-task
            Reporter: Richard Opalka




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


[jira] Assigned: (CXF-1623) Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches() method implementation or preconditions

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

Daniel Kulp reassigned CXF-1623:
--------------------------------

    Assignee: Daniel Kulp

> Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches()  method implementation or preconditions
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1623
>                 URL: https://issues.apache.org/jira/browse/CXF-1623
>             Project: CXF
>          Issue Type: Sub-task
>    Affects Versions: 2.1
>            Reporter: Richard Opalka
>            Assignee: Daniel Kulp
>


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


[jira] Commented: (CXF-1623) Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches() method implementation or preconditions

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601651#action_12601651 ] 

Daniel Kulp commented on CXF-1623:
----------------------------------



I'll have to dig into the code some more to figure out a correct fix, but I'll try to answer the questions...

1) Possibly.  It may depend on what is needed to get the fix in place.   

2) In JAXWS, the binding (soap/xml) and the transport (http) are merged into a single string.   In CXF, they are completely separate so that things like SOAP over JMS and stuff can properly be modeled.   Thus, that code maps the JAX-WS merged binding into the form we need that just says "soap" so the proper CXF binding can be picked up.    That code is probably "correct", although it's possible that it should be set to "http://schemas.xmlsoap.org/wsdl/soap/" instead of "http://schemas.xmlsoap.org/soap/".    If that is done, I think your use case would work fine as the name.contains(id) would actually pass.   




> Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches()  method implementation or preconditions
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1623
>                 URL: https://issues.apache.org/jira/browse/CXF-1623
>             Project: CXF
>          Issue Type: Sub-task
>            Reporter: Richard Opalka
>


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


[jira] Commented: (CXF-1623) Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches() method implementation or preconditions

Posted by "Richard Opalka (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666098#action_12666098 ] 

Richard Opalka commented on CXF-1623:
-------------------------------------

Thanks for the fix

> Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches()  method implementation or preconditions
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1623
>                 URL: https://issues.apache.org/jira/browse/CXF-1623
>             Project: CXF
>          Issue Type: Sub-task
>    Affects Versions: 2.1
>            Reporter: Richard Opalka
>            Assignee: Daniel Kulp
>             Fix For: 2.1.1
>
>


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


[jira] Commented: (CXF-1623) Wrong method implementation in AnnotationHandlerChainBuilder

Posted by "Richard Opalka (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601634#action_12601634 ] 

Richard Opalka commented on CXF-1623:
-------------------------------------

After execution of line: String name = el.getTextContent().trim();  
the name string variable is initialized to "##SOAP11_HTTP".
But the string id (method parameter) holds value "http://schemas.xmlsoap.org/soap/"
(just FYI this value is set in JaxWsServerFactoryBean.createBindingInfo() method
on line 126 in CXF 2.1 source distribution.)
Thus the last line in the above method badly returns false instead of expected true.



> Wrong method implementation in AnnotationHandlerChainBuilder
> ------------------------------------------------------------
>
>                 Key: CXF-1623
>                 URL: https://issues.apache.org/jira/browse/CXF-1623
>             Project: CXF
>          Issue Type: Sub-task
>            Reporter: Richard Opalka
>


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


[jira] Commented: (CXF-1623) Wrong method implementation in AnnotationHandlerChainBuilder

Posted by "Richard Opalka (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601631#action_12601631 ] 

Richard Opalka commented on CXF-1623:
-------------------------------------

The following method is either wrongly implemented or it has wrong preconditions:

private boolean protocolMatches(Element el, String id) {
        if (id == null) {
            return true;
        }
        String name = el.getTextContent().trim();
        if ("##SOAP11_HTTP".equals(name)) {
            name = "http://schemas.xmlsoap.org/wsdl/soap/http";
        } else if ("##SOAP11_HTTP_MTOM".equals(name)) {
            name = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true";
        } else if ("##SOAP12_HTTP".equals(name)) {
            name = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
        } else if ("##SOAP12_HTTP_MTOM".equals(name)) {
            name = "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true";
        } else if ("##XML_HTTP".equals(name)) {
            name = "http://www.w3.org/2004/08/wsdl/http";
        }
        return name.contains(id);
    }


> Wrong method implementation in AnnotationHandlerChainBuilder
> ------------------------------------------------------------
>
>                 Key: CXF-1623
>                 URL: https://issues.apache.org/jira/browse/CXF-1623
>             Project: CXF
>          Issue Type: Sub-task
>            Reporter: Richard Opalka
>


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


[jira] Updated: (CXF-1623) Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches() method implementation or preconditions

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

Richard Opalka updated CXF-1623:
--------------------------------

    Affects Version/s: 2.1

> Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches()  method implementation or preconditions
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1623
>                 URL: https://issues.apache.org/jira/browse/CXF-1623
>             Project: CXF
>          Issue Type: Sub-task
>    Affects Versions: 2.1
>            Reporter: Richard Opalka
>


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


[jira] Commented: (CXF-1623) Wrong method implementation in AnnotationHandlerChainBuilder

Posted by "Richard Opalka (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601639#action_12601639 ] 

Richard Opalka commented on CXF-1623:
-------------------------------------

The questions are:

Q1: Is this method implementation correct?

I personally think yes but it has wrong preconditions.
It expects id to be one of 5 enumerated values there.

Q2: Is the hack in JaxWsServerFactoryBean.createBindingInfo() method necessary?

At least I know this hack breaks the above method (it's preconditions).
I'm talking about this piece of code:
        ...
        if (binding == null) {
            binding = jaxBid;
            setBindingId(binding); // this sets correct value first (in my case "http://schemas.xmlsoap.org/wsdl/soap/http"
        }
        
        if (binding.equals(SOAPBinding.SOAP11HTTP_BINDING) 
            || binding.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)
            //|| binding.equals(SOAPBinding.SOAP12HTTP_BINDING) 
            || binding.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
            binding = "http://schemas.xmlsoap.org/soap/";
            setBindingId(binding); // but here this hack resets this value to "http://schemas.xmlsoap.org/soap/" and this hacked value later in the execution breaks AnnotationHandlerChainBuilder.protocolMatches() method preconditions
         ...

> Wrong method implementation in AnnotationHandlerChainBuilder
> ------------------------------------------------------------
>
>                 Key: CXF-1623
>                 URL: https://issues.apache.org/jira/browse/CXF-1623
>             Project: CXF
>          Issue Type: Sub-task
>            Reporter: Richard Opalka
>


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


[jira] Updated: (CXF-1623) Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches() method implementation or preconditions

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

Richard Opalka updated CXF-1623:
--------------------------------

    Summary: Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches()  method implementation or preconditions  (was: Wrong method implementation in AnnotationHandlerChainBuilder)

> Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches()  method implementation or preconditions
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1623
>                 URL: https://issues.apache.org/jira/browse/CXF-1623
>             Project: CXF
>          Issue Type: Sub-task
>            Reporter: Richard Opalka
>


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


[jira] Resolved: (CXF-1623) Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches() method implementation or preconditions

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

Daniel Kulp resolved CXF-1623.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.1

> Wrong org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.protocolMatches()  method implementation or preconditions
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1623
>                 URL: https://issues.apache.org/jira/browse/CXF-1623
>             Project: CXF
>          Issue Type: Sub-task
>    Affects Versions: 2.1
>            Reporter: Richard Opalka
>            Assignee: Daniel Kulp
>             Fix For: 2.1.1
>
>


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