[ 
https://issues.apache.org/jira/browse/AXIS2-4378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719756#action_12719756
 ] 

Ben Reif commented on AXIS2-4378:
---------------------------------

Here's one suggested fix, I'd be curious to hear any feedback.

Modify the code in the populateBindingOperation() method of the 
org.apache.axis2.deployment.util.Utils Class so that it also checks to see if 
there is an AxisMessage in addition to checking the MEP:

private static void populateBindingOperation(AxisService axisService,
                        AxisBinding axisBinding, AxisBindingOperation 
axisBindingOperation) {

                AxisOperation axisOperation = 
axisBindingOperation.getAxisOperation();

                //Fix for AXIS2-4378
//              if (WSDLUtil.isInputPresentForMEP(axisOperation
//                              .getMessageExchangePattern())) {
                if 
(WSDLUtil.isInputPresentForMEP(axisOperation.getMessageExchangePattern()) ||
                                
axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE) != null) {
                //Fix for AXIS2-4378    
                        AxisMessage axisInMessage = axisOperation
                                        
.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                        AxisBindingMessage axisBindingInMessage = new 
AxisBindingMessage();

                        axisBindingInMessage.setName(axisInMessage.getName());
                        
axisBindingInMessage.setDirection(axisInMessage.getDirection());
                        axisBindingInMessage.setAxisMessage(axisInMessage);

                        axisBindingInMessage.setParent(axisBindingOperation);
                        
axisBindingOperation.addChild(WSDLConstants.MESSAGE_LABEL_IN_VALUE,
                                        axisBindingInMessage);
                }

                //Fix for AXIS2-4378
//              if (WSDLUtil.isOutputPresentForMEP(axisOperation
//                              .getMessageExchangePattern())) {
                if 
(WSDLUtil.isOutputPresentForMEP(axisOperation.getMessageExchangePattern()) ||
                                
axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE) != null) {
                //Fix for AXIS2-4378    
                        AxisMessage axisOutMessage = axisOperation
                                        
.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                        AxisBindingMessage axisBindingOutMessage = new 
AxisBindingMessage();

                        axisBindingOutMessage.setName(axisOutMessage.getName());
                        
axisBindingOutMessage.setDirection(axisOutMessage.getDirection());
                        axisBindingOutMessage.setAxisMessage(axisOutMessage);

                        axisBindingOutMessage.setParent(axisBindingOperation);
                        axisBindingOperation.addChild(
                                        WSDLConstants.MESSAGE_LABEL_OUT_VALUE,
                                        axisBindingOutMessage);
                }

                ArrayList faultMessagesList = axisOperation.getFaultMessages();
                for (Iterator iterator2 = faultMessagesList.iterator(); 
iterator2
                                .hasNext();) {
                        AxisMessage axisFaultMessage = (AxisMessage) 
iterator2.next();
                        AxisBindingMessage axisBindingFaultMessage = new 
AxisBindingMessage();
            axisBindingFaultMessage.setName(axisFaultMessage.getName());
            axisBindingFaultMessage.setFault(true);
                        
axisBindingFaultMessage.setAxisMessage(axisFaultMessage);
                        axisBindingFaultMessage.setParent(axisBindingOperation);
                        axisBindingOperation.addFault(axisBindingFaultMessage);
            axisBinding.addFault(axisBindingFaultMessage);
        }

                axisBindingOperation.setAxisOperation(axisOperation);
                axisBindingOperation.setParent(axisBinding);
        }

> Java2WSDL - Invalid WSDL for DOC/LIT wrapped operations that return Void 
> -------------------------------------------------------------------------
>
>                 Key: AXIS2-4378
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4378
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.4
>            Reporter: Ben Reif
>
> It seems that there is an inconsistency in the generated WSDL, with 
> operations that return void, that comes from the Java2WSDLBuilder. My MEP is 
> http://www.w3.org/ns/wsdl/robust-in-only. After it runs, it generates a 
> <wsdl:output> element in the <wsdl:portType> operation, but there isn't one 
> in the <wsdl:binding> operation definition. This causes some WSDL validators 
> to fail.
> To generate the <wsdl:output> in the <wsdl:portType> it seems that the 
> AxisService2WSDL11.generatePortType() method, it's checking for that MEP and 
> then just checking to make sure that the AxisMessage from the AxisOperation 
> is not null.
> To generate the <wsdl:output> in the <wsdl:binding> it seems that the 
> AxisService2WSDL11.generateSoap11Binding() method is checking for that MEP 
> and then just checking that the AxisBindingMessage on the 
> AxisBindingOperation is not null. In this case I think that the 
> AxisBindingMessage is null, because the WSDLUtil.isOutputPresentForMEP() 
> method is not checking for the Robust-In-Only MEP (which is the trigger to 
> create the AxisBindingMessage ), however the output AxisMessage on the 
> AxisOperation is not null.
> I think that either the WSDLUtil.isOutputPresentForMEP() method should be 
> fixed to check for that MEP, or else the 
> AxisService2WSDL11.generateSoap11Binding() method should also check the 
> output message on the AxisOperation. Another option is to fix the code so 
> that the the <wsdl:operation> is not created in the <wsdl:portType> operation 
> either.

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

Reply via email to