axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Reif (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AXIS2-4559) WSDL11ToAxisServiceBuilder.getMEP(Operation) doesn't always return the correct MEP
Date Thu, 19 Nov 2009 14:53:39 GMT

     [ https://issues.apache.org/jira/browse/AXIS2-4559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ben Reif updated AXIS2-4559:
----------------------------

    Description: 
If you want to define a Robust-In-Only operation in WSDL 1.1 you can't just define a <wsdl:operation>
in a <wsdl:portType> that only has a <wsdl:input> and a <wsdl:fault>. The
schema says that you have to also define a <wsdl:output> tag, which then gets mapped
to an empty <wsdl:message> element.

Because the operation now has a <wsdl:input> and also a <wsdl:output>, this causes
the WSDL parser to set the operation style to REQUEST-RESPONSE instead of ONE-WAY. This might
seem to be an issue with the WSDL parser, but one could make the argument that WSDL 1.1 doesn't
support the Robust-In-Only MEP. However, it seems that the Axis2 code has been written to
account for it anyway.

Rather then just relying on the Operation.getStyle() method to determine the MEP, the WSDL11ToAxisServiceBuilder.getMEP(Operation)
method should be looking at the Message Parts within the Input and Output to determine the
correct MEP. Maybe something similar to this (it probably needs to be formatted):

private String getMEP(Operation operation) throws AxisFault {
        OperationType operationType = operation.getStyle();
        if (isServerSide) {
            if (operationType != null) {            	
                if (operationType.equals(OperationType.REQUEST_RESPONSE)) {
                	//Fix for AXIS2-4559
                	//Check if it's really One-Way
            		if(operation.getOutput().getMessage().getParts().isEmpty()){
            			if(operation.getFaults().size() > 0) {
            				return WSDL2Constants.MEP_URI_ROBUST_IN_ONLY;        				
            			}
            			return WSDL2Constants.MEP_URI_IN_ONLY;
            		}
            		//End Fix for AXIS2-4559
                    return WSDL2Constants.MEP_URI_IN_OUT;
                }                

                if (operationType.equals(OperationType.ONE_WAY)) {
                    if (operation.getFaults().size() > 0) {
                        return WSDL2Constants.MEP_URI_ROBUST_IN_ONLY;
                    }
                    return WSDL2Constants.MEP_URI_IN_ONLY;
                }

                if (operationType.equals(OperationType.NOTIFICATION)) {
                    return WSDL2Constants.MEP_URI_OUT_ONLY;
                }

                if (operationType.equals(OperationType.SOLICIT_RESPONSE)) {
                    return WSDL2Constants.MEP_URI_OUT_IN;
                }
                throw new AxisFault("Cannot Determine the MEP");
            }
        } else {
            if (operationType != null) {
                if (operationType.equals(OperationType.REQUEST_RESPONSE)) {
                	//Fix for AXIS2-4559
                	if(operation.getOutput().getMessage().getParts().isEmpty()){
            			if(operation.getFaults().size() > 0) {
            				return WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY;        				
            			}
            			return WSDL2Constants.MEP_URI_OUT_ONLY;
            		}
                	//End Fix for AXIS2-4559
                    return WSDL2Constants.MEP_URI_OUT_IN;
                }

                if (operationType.equals(OperationType.ONE_WAY)) {
                	//Fix for AXIS2-4559
                	if (operation.getFaults().size() > 0) {
                        return WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY;
                    }
                	//End Fix for AXIS2-4559
                    return WSDL2Constants.MEP_URI_OUT_ONLY;
                }

                if (operationType.equals(OperationType.NOTIFICATION)) {
                    return WSDL2Constants.MEP_URI_IN_ONLY;
                }

                if (operationType.equals(OperationType.SOLICIT_RESPONSE)) {
                    return WSDL2Constants.MEP_URI_IN_OUT;
                }
                throw new AxisFault("Cannot Determine the MEP");
            }
        }
        throw new AxisFault("Cannot Determine the MEP");
    }

  was:
If you want to define a Robust-In-Only operation in WSDL 1.1 you can't just define a <wsdl:operation>
in a <wsdl:portType> that only has a <wsdl:input> and a <wsdl:fault>. The
schema says that you have to also define a <wsdl:output> tag, which then gets mapped
to an empty <wsdl:message> element.

Because the operation now has a <wsdl:input> and also a <wsdl:output>, this causes
the WSDL parser to set the operation style to REQUEST-RESPONSE instead of ONE-WAY. This might
seem to be an issue with the WSDL parser, but one could make the argument that WSDL 1.1 doesn't
support the Robust-In-Only MEP. However, it seems that the Axis2 code has been written to
account for it anyway.

Rather then just relying on the Operation.getStyle() method to determine the MEP, the WSDL11ToAxisServiceBuilder.getMEP(Operation)
method should be looking at the Message Parts within the Input and Output to determine the
correct MEP. Maybe something similar to this:

private String getMEP(Operation operation) throws AxisFault {        
	if (isServerSide) {
		if(OperationType.NOTIFICATION.equals(operation.getStyle())){
			return WSDL2Constants.MEP_URI_OUT_ONLY;
		} else if(OperationType.SOLICIT_RESPONSE.equals(operation.getStyle())){
			return WSDL2Constants.MEP_URI_OUT_IN;
		} else if(!operation.getInput().getMessage().getParts().isEmpty()){
			if(!operation.getOutput().getMessage().getParts().isEmpty()){
				return WSDL2Constants.MEP_URI_IN_OUT;
			} else if(operation.getFaults().isEmpty()) {
				return WSDL2Constants.MEP_URI_IN_ONLY;
			} else {
				return WSDL2Constants.MEP_URI_ROBUST_IN_ONLY;
			}
		} else {
			return WSDL2Constants.MEP_URI_IN_OUT;
		}
	}
	else {
		if(OperationType.NOTIFICATION.equals(operation.getStyle())){
			return WSDL2Constants.MEP_URI_IN_ONLY;
		} else if(OperationType.SOLICIT_RESPONSE.equals(operation.getStyle())){
			return WSDL2Constants.MEP_URI_IN_OUT;
		} else if(!operation.getInput().getMessage().getParts().isEmpty()){
			if(!operation.getOutput().getMessage().getParts().isEmpty()){
				return WSDL2Constants.MEP_URI_OUT_IN;
			} else if(operation.getFaults().isEmpty()) {
				return WSDL2Constants.MEP_URI_OUT_ONLY;
			} else {
				return WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY;
			}
		} else {
			return WSDL2Constants.MEP_URI_OUT_IN;
		}
	}
}


> WSDL11ToAxisServiceBuilder.getMEP(Operation) doesn't always return the correct MEP
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-4559
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4559
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: deployment, wsdl
>    Affects Versions: 1.4
>            Reporter: Ben Reif
>
> If you want to define a Robust-In-Only operation in WSDL 1.1 you can't just define a
<wsdl:operation> in a <wsdl:portType> that only has a <wsdl:input> and a
<wsdl:fault>. The schema says that you have to also define a <wsdl:output> tag,
which then gets mapped to an empty <wsdl:message> element.
> Because the operation now has a <wsdl:input> and also a <wsdl:output>, this
causes the WSDL parser to set the operation style to REQUEST-RESPONSE instead of ONE-WAY.
This might seem to be an issue with the WSDL parser, but one could make the argument that
WSDL 1.1 doesn't support the Robust-In-Only MEP. However, it seems that the Axis2 code has
been written to account for it anyway.
> Rather then just relying on the Operation.getStyle() method to determine the MEP, the
WSDL11ToAxisServiceBuilder.getMEP(Operation) method should be looking at the Message Parts
within the Input and Output to determine the correct MEP. Maybe something similar to this
(it probably needs to be formatted):
> private String getMEP(Operation operation) throws AxisFault {
>         OperationType operationType = operation.getStyle();
>         if (isServerSide) {
>             if (operationType != null) {            	
>                 if (operationType.equals(OperationType.REQUEST_RESPONSE)) {
>                 	//Fix for AXIS2-4559
>                 	//Check if it's really One-Way
>             		if(operation.getOutput().getMessage().getParts().isEmpty()){
>             			if(operation.getFaults().size() > 0) {
>             				return WSDL2Constants.MEP_URI_ROBUST_IN_ONLY;        				
>             			}
>             			return WSDL2Constants.MEP_URI_IN_ONLY;
>             		}
>             		//End Fix for AXIS2-4559
>                     return WSDL2Constants.MEP_URI_IN_OUT;
>                 }                
>                 if (operationType.equals(OperationType.ONE_WAY)) {
>                     if (operation.getFaults().size() > 0) {
>                         return WSDL2Constants.MEP_URI_ROBUST_IN_ONLY;
>                     }
>                     return WSDL2Constants.MEP_URI_IN_ONLY;
>                 }
>                 if (operationType.equals(OperationType.NOTIFICATION)) {
>                     return WSDL2Constants.MEP_URI_OUT_ONLY;
>                 }
>                 if (operationType.equals(OperationType.SOLICIT_RESPONSE)) {
>                     return WSDL2Constants.MEP_URI_OUT_IN;
>                 }
>                 throw new AxisFault("Cannot Determine the MEP");
>             }
>         } else {
>             if (operationType != null) {
>                 if (operationType.equals(OperationType.REQUEST_RESPONSE)) {
>                 	//Fix for AXIS2-4559
>                 	if(operation.getOutput().getMessage().getParts().isEmpty()){
>             			if(operation.getFaults().size() > 0) {
>             				return WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY;        				
>             			}
>             			return WSDL2Constants.MEP_URI_OUT_ONLY;
>             		}
>                 	//End Fix for AXIS2-4559
>                     return WSDL2Constants.MEP_URI_OUT_IN;
>                 }
>                 if (operationType.equals(OperationType.ONE_WAY)) {
>                 	//Fix for AXIS2-4559
>                 	if (operation.getFaults().size() > 0) {
>                         return WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY;
>                     }
>                 	//End Fix for AXIS2-4559
>                     return WSDL2Constants.MEP_URI_OUT_ONLY;
>                 }
>                 if (operationType.equals(OperationType.NOTIFICATION)) {
>                     return WSDL2Constants.MEP_URI_IN_ONLY;
>                 }
>                 if (operationType.equals(OperationType.SOLICIT_RESPONSE)) {
>                     return WSDL2Constants.MEP_URI_IN_OUT;
>                 }
>                 throw new AxisFault("Cannot Determine the MEP");
>             }
>         }
>         throw new AxisFault("Cannot Determine the MEP");
>     }

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


Mime
View raw message