You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Rich Scheuerle (JIRA)" <ji...@apache.org> on 2008/01/17 15:24:33 UTC

[jira] Created: (AXIS2-3457) Incorrect Exception in WSDL11ToAxisServiceBuilder

Incorrect Exception in WSDL11ToAxisServiceBuilder
-------------------------------------------------

                 Key: AXIS2-3457
                 URL: https://issues.apache.org/jira/browse/AXIS2-3457
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
            Reporter: Rich Scheuerle
            Assignee: Rich Scheuerle


Background
WSDL11ToAxisServiceBuilder contains code to produce schema "wrapper" code  for selected BindingOperations (i.e. RPC literal bindings).
 
Problem:
I have a WSDL with several bindings, one of them is an HTTP Binding.  The current code determines that its BindingOperations require wrappering, but
during the schema generation it throws the following error because it incorrectly assumes that the BindingOperation is RPC/literal.

 org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService RPC-literal type message part Body should have a type attribute 

Proposed Solution:
I have just started working on this issue.  My thought is to introduce a private inner class BindingOperationEntry.  The BindingOperationEntry will contain the BindingOperation and information about the BindingOperation (i.e. isRPC()).  

The findWrappableBindingOperations(Binding binding) method will be changed to return a List of BindingOperationEntry instead of  List of BindingOperation.  Later processing can then easily distinguish between RPC and HTTP usage.  

In addition, I am going to upgrade the exception message (which confused the user) and add some additional trace.

This solution has minimal impact on the existing structure of WSDL11ToAxisServiceBuilder, which is why I pursuing this approach.

Comments ?

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3457) Incorrect Exception in WSDL11ToAxisServiceBuilder

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560478#action_12560478 ] 

Rich Scheuerle commented on AXIS2-3457:
---------------------------------------

Amila,

I see your point.  Thanks for the thorough explanation.

I understand that we always want to throw the exception for SOAP RPC, and yes I will make that exception more descriptive.

But for the HTTP case, we could change the code to indicate that it is "possibly" wrapped.  
Something like the following:

          First assume that wrappableOperations is a list of BindingOperationEntry's, where we can add some additional state (like isHTTPBinding).

          Then in addPartToElement we detect that the BindingEntryOperation is isHTTPBinding and that the message (in) is an element.
          Instead of throwing an exception, we set isInWrapped=false.

          Then the following code would be changed to something like.
                if (isSetMessageQNames) {
                    BindingOperationEntry boe = getBindingOperationEntry(wrappableOperations, wsdl4jBindingOperation);

                    boolean isWrapped = (boe == null) ? false : boe.isWrapped;

                    addQNameReference(axisInMessage, wsdl4jOperation,
                                      wsdl4jBindingInput,
                                      isWrapped);
                }

   By introducing a BindingOperation, it is now easier to carry around state about the BindingOperation.  This gives us more flexibility.

Comments ?

> Incorrect Exception in WSDL11ToAxisServiceBuilder
> -------------------------------------------------
>
>                 Key: AXIS2-3457
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3457
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Background
> WSDL11ToAxisServiceBuilder contains code to produce schema "wrapper" code  for selected BindingOperations (i.e. RPC literal bindings).
>  
> Problem:
> I have a WSDL with several bindings, one of them is an HTTP Binding.  The current code determines that its BindingOperations require wrappering, but
> during the schema generation it throws the following error because it incorrectly assumes that the BindingOperation is RPC/literal.
>  org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService RPC-literal type message part Body should have a type attribute 
> Proposed Solution:
> I have just started working on this issue.  My thought is to introduce a private inner class BindingOperationEntry.  The BindingOperationEntry will contain the BindingOperation and information about the BindingOperation (i.e. isRPC()).  
> The findWrappableBindingOperations(Binding binding) method will be changed to return a List of BindingOperationEntry instead of  List of BindingOperation.  Later processing can then easily distinguish between RPC and HTTP usage.  
> In addition, I am going to upgrade the exception message (which confused the user) and add some additional trace.
> This solution has minimal impact on the existing structure of WSDL11ToAxisServiceBuilder, which is why I pursuing this approach.
> Comments ?

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3457) Incorrect Exception in WSDL11ToAxisServiceBuilder

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559957#action_12559957 ] 

Rich Scheuerle commented on AXIS2-3457:
---------------------------------------

Here is a snippet of the code that I will add to addPartToElement:

String bindingOperationName = boe.getBindingOperation().getName();
            String partName = part.getName();
            if (boe.isRPC()) {
                // see the basic profile 4.4.1 for rpc-literal.
                // messages parts can have only types
                throw new WSDLProcessingException(
                   "The binding operation " + bindingOperationName + " is RPC/literal. " +
                   "The message parts for this operation must use the type " +
                   "attribute as specificed by " +
                   "WS-I Basic Profile specification (4.4.1).  Message part, " + 
                   partName + ", violates" +
                   "this rule.  Please remove the element attribute " +
                   "and use the type attribute.");
            } else {
                // Don't add this part
                if (log.isDebugEnabled()) {
                    log.debug("The binding operation " + bindingOperationName + 
                              " references message part " +
                              partName + ".  This part does not use the " +
                              "type attribute, so a wrappering element is not added.");
                }
            }

> Incorrect Exception in WSDL11ToAxisServiceBuilder
> -------------------------------------------------
>
>                 Key: AXIS2-3457
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3457
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Background
> WSDL11ToAxisServiceBuilder contains code to produce schema "wrapper" code  for selected BindingOperations (i.e. RPC literal bindings).
>  
> Problem:
> I have a WSDL with several bindings, one of them is an HTTP Binding.  The current code determines that its BindingOperations require wrappering, but
> during the schema generation it throws the following error because it incorrectly assumes that the BindingOperation is RPC/literal.
>  org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService RPC-literal type message part Body should have a type attribute 
> Proposed Solution:
> I have just started working on this issue.  My thought is to introduce a private inner class BindingOperationEntry.  The BindingOperationEntry will contain the BindingOperation and information about the BindingOperation (i.e. isRPC()).  
> The findWrappableBindingOperations(Binding binding) method will be changed to return a List of BindingOperationEntry instead of  List of BindingOperation.  Later processing can then easily distinguish between RPC and HTTP usage.  
> In addition, I am going to upgrade the exception message (which confused the user) and add some additional trace.
> This solution has minimal impact on the existing structure of WSDL11ToAxisServiceBuilder, which is why I pursuing this approach.
> Comments ?

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3457) Incorrect Exception in WSDL11ToAxisServiceBuilder

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560921#action_12560921 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3457:
-----------------------------------------------------

OK +1 to do this change.
Please make sure you change all the places referring to addQNameReference.

> Incorrect Exception in WSDL11ToAxisServiceBuilder
> -------------------------------------------------
>
>                 Key: AXIS2-3457
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3457
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Background
> WSDL11ToAxisServiceBuilder contains code to produce schema "wrapper" code  for selected BindingOperations (i.e. RPC literal bindings).
>  
> Problem:
> I have a WSDL with several bindings, one of them is an HTTP Binding.  The current code determines that its BindingOperations require wrappering, but
> during the schema generation it throws the following error because it incorrectly assumes that the BindingOperation is RPC/literal.
>  org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService RPC-literal type message part Body should have a type attribute 
> Proposed Solution:
> I have just started working on this issue.  My thought is to introduce a private inner class BindingOperationEntry.  The BindingOperationEntry will contain the BindingOperation and information about the BindingOperation (i.e. isRPC()).  
> The findWrappableBindingOperations(Binding binding) method will be changed to return a List of BindingOperationEntry instead of  List of BindingOperation.  Later processing can then easily distinguish between RPC and HTTP usage.  
> In addition, I am going to upgrade the exception message (which confused the user) and add some additional trace.
> This solution has minimal impact on the existing structure of WSDL11ToAxisServiceBuilder, which is why I pursuing this approach.
> Comments ?

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3457) Incorrect Exception in WSDL11ToAxisServiceBuilder

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559956#action_12559956 ] 

Rich Scheuerle commented on AXIS2-3457:
---------------------------------------

The net effect of this change is that the exception will only be thrown if the refencing BindingOperation is SOAP RPC.

> Incorrect Exception in WSDL11ToAxisServiceBuilder
> -------------------------------------------------
>
>                 Key: AXIS2-3457
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3457
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Background
> WSDL11ToAxisServiceBuilder contains code to produce schema "wrapper" code  for selected BindingOperations (i.e. RPC literal bindings).
>  
> Problem:
> I have a WSDL with several bindings, one of them is an HTTP Binding.  The current code determines that its BindingOperations require wrappering, but
> during the schema generation it throws the following error because it incorrectly assumes that the BindingOperation is RPC/literal.
>  org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService RPC-literal type message part Body should have a type attribute 
> Proposed Solution:
> I have just started working on this issue.  My thought is to introduce a private inner class BindingOperationEntry.  The BindingOperationEntry will contain the BindingOperation and information about the BindingOperation (i.e. isRPC()).  
> The findWrappableBindingOperations(Binding binding) method will be changed to return a List of BindingOperationEntry instead of  List of BindingOperation.  Later processing can then easily distinguish between RPC and HTTP usage.  
> In addition, I am going to upgrade the exception message (which confused the user) and add some additional trace.
> This solution has minimal impact on the existing structure of WSDL11ToAxisServiceBuilder, which is why I pursuing this approach.
> Comments ?

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3457) Incorrect Exception in WSDL11ToAxisServiceBuilder

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560217#action_12560217 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3457:
-----------------------------------------------------

see WSDL11ToAxisServiceBuilder.java 675
if (isSetMessageQNames) {
                    addQNameReference(axisInMessage, wsdl4jOperation,
                                      wsdl4jBindingInput,
                                      wrappableOperations.contains(wsdl4jBindingOperation));
                }

and addQNameReference Method

if (isWrapped) {
            // we have already validated and process the qname references
            // so set it here
            // The schema for this should be already made ! Find the
            // QName from
            // the list and add it - the name for this is just the
            message.setElementQName((QName) resolvedRpcWrappedElementMap
                    .get(rpcOperationName));
            message.getAxisOperation().getAxisService().addMessageElementQNameToOperationMapping(
                    (QName) resolvedRpcWrappedElementMap.get(rpcOperationName),
                    message.getAxisOperation());
        }

This is what happens. in the findWrappableBindingOperations method we find the wrappable operations and put them to wrappableOperations list. And at the createSchemaForPorttype method populate the resolvedRpcWrappedElementMap.

So it always expect a entry in the later map for all wrappable operations. so simply ignoring the exception would cause a problem here.

On the other hand suspending that exception means we allow people to use element attribute at the message part level. As I told you this is not something that spec has not clearly mentioned. at least I could not find any place.

So my suggestion is to throw that exception. But add a meaning full message.
we can simply pass another boolean attribute to the createSchemaForPorttype method
(like boolean isHttpBinding) and if so change the exception message into
"Axis2 only supports type attribute at the part level for Http Binding".



> Incorrect Exception in WSDL11ToAxisServiceBuilder
> -------------------------------------------------
>
>                 Key: AXIS2-3457
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3457
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Background
> WSDL11ToAxisServiceBuilder contains code to produce schema "wrapper" code  for selected BindingOperations (i.e. RPC literal bindings).
>  
> Problem:
> I have a WSDL with several bindings, one of them is an HTTP Binding.  The current code determines that its BindingOperations require wrappering, but
> during the schema generation it throws the following error because it incorrectly assumes that the BindingOperation is RPC/literal.
>  org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService RPC-literal type message part Body should have a type attribute 
> Proposed Solution:
> I have just started working on this issue.  My thought is to introduce a private inner class BindingOperationEntry.  The BindingOperationEntry will contain the BindingOperation and information about the BindingOperation (i.e. isRPC()).  
> The findWrappableBindingOperations(Binding binding) method will be changed to return a List of BindingOperationEntry instead of  List of BindingOperation.  Later processing can then easily distinguish between RPC and HTTP usage.  
> In addition, I am going to upgrade the exception message (which confused the user) and add some additional trace.
> This solution has minimal impact on the existing structure of WSDL11ToAxisServiceBuilder, which is why I pursuing this approach.
> Comments ?

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-3457) Incorrect Exception in WSDL11ToAxisServiceBuilder

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

Rich Scheuerle resolved AXIS2-3457.
-----------------------------------

    Resolution: Fixed

Committed 613936

> Incorrect Exception in WSDL11ToAxisServiceBuilder
> -------------------------------------------------
>
>                 Key: AXIS2-3457
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3457
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Background
> WSDL11ToAxisServiceBuilder contains code to produce schema "wrapper" code  for selected BindingOperations (i.e. RPC literal bindings).
>  
> Problem:
> I have a WSDL with several bindings, one of them is an HTTP Binding.  The current code determines that its BindingOperations require wrappering, but
> during the schema generation it throws the following error because it incorrectly assumes that the BindingOperation is RPC/literal.
>  org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService RPC-literal type message part Body should have a type attribute 
> Proposed Solution:
> I have just started working on this issue.  My thought is to introduce a private inner class BindingOperationEntry.  The BindingOperationEntry will contain the BindingOperation and information about the BindingOperation (i.e. isRPC()).  
> The findWrappableBindingOperations(Binding binding) method will be changed to return a List of BindingOperationEntry instead of  List of BindingOperation.  Later processing can then easily distinguish between RPC and HTTP usage.  
> In addition, I am going to upgrade the exception message (which confused the user) and add some additional trace.
> This solution has minimal impact on the existing structure of WSDL11ToAxisServiceBuilder, which is why I pursuing this approach.
> Comments ?

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3457) Incorrect Exception in WSDL11ToAxisServiceBuilder

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12559946#action_12559946 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3457:
-----------------------------------------------------

I agree with you that this exception is misleading.

The problem I found when doing this was that wsdl specification does not define the HTTP binding properly and there no details even in the WS-I basic profile.

the only sample given in the wsdl spec has a rpc type sample. message part refers to an type. 

what is the functionality wise feature you are going to add by doing this change?

my understanding is that for HTTP binding it is better to use the wsdl2.0 instead of wsdl1.1. 



> Incorrect Exception in WSDL11ToAxisServiceBuilder
> -------------------------------------------------
>
>                 Key: AXIS2-3457
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3457
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Background
> WSDL11ToAxisServiceBuilder contains code to produce schema "wrapper" code  for selected BindingOperations (i.e. RPC literal bindings).
>  
> Problem:
> I have a WSDL with several bindings, one of them is an HTTP Binding.  The current code determines that its BindingOperations require wrappering, but
> during the schema generation it throws the following error because it incorrectly assumes that the BindingOperation is RPC/literal.
>  org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService RPC-literal type message part Body should have a type attribute 
> Proposed Solution:
> I have just started working on this issue.  My thought is to introduce a private inner class BindingOperationEntry.  The BindingOperationEntry will contain the BindingOperation and information about the BindingOperation (i.e. isRPC()).  
> The findWrappableBindingOperations(Binding binding) method will be changed to return a List of BindingOperationEntry instead of  List of BindingOperation.  Later processing can then easily distinguish between RPC and HTTP usage.  
> In addition, I am going to upgrade the exception message (which confused the user) and add some additional trace.
> This solution has minimal impact on the existing structure of WSDL11ToAxisServiceBuilder, which is why I pursuing this approach.
> Comments ?

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org