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

Pétur Runólfsson commented on AXIS2-4350:
-----------------------------------------

I ran into this problem also. I think that the problem isn't in RPCUtil, 
instead the problem is that inAxisMessage.isWrapped() is incorrectly returning 
false, causing the code in the else block to be executed instead of the code in 
the if block. 

The only way to make isWrapped return true (short of modifying the code) seems 
to be to add style="rpc" to the soap:operation elements in the WSDL. The 
default value for style seems to be style="document". This seems to be a bug 
somewhere in Axis (either in Java2wsdl or in the wsdl parser) because this 
breaks simple usage like:

1. Write simple POJO web service.
2. Run it through java2wsdl with no extra options
3. Deploy service with generated wsdl

The service in this case is unusable because java2wsdl by default generates a 
wsdl in the wrapped style, but with style="document". When the service is 
deployed, Axis assumes that the wsdl style is not wrapped.

An interesting angle is that if Axis generates the wsdl at runtime, exactly the 
same wsdl is generated (with style="document"), but everything works (so it 
seems that isWrapped gets somehow set to true in this case).


> RPCUtil handles wrapped style of SOAP messages wrongly. 
> --------------------------------------------------------
>
>                 Key: AXIS2-4350
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4350
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.5
>            Reporter: Oleg Zenzin
>
> Class 
> http://svn.apache.org/repos/asf/webservices/axis2/branches/java/1_5/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
>  in the method invokeServiceClass() has following lines:
>            if (inAxisMessage.isWrapped()) {
>                 objectArray = RPCUtil.processRequest(methodElement,
>                         method, 
> inMessage.getAxisService().getObjectSupplier());
>             } else {
>                 objectArray = RPCUtil.processRequest((OMElement) 
> methodElement.getParent(),
>                         method, 
> inMessage.getAxisService().getObjectSupplier());
>             }
> which wrongly handles the wrapped style of SOAP messages. Like, for instance 
> this message:
> <?xml version='1.0' encoding='UTF-8'?> 
>    <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> 
>       <soapenv:Header> 
>          <addr:To 
> xmlns:addr="http://www.w3.org/2005/08/addressing";>http://localhost:8383/bre/services/dtws_tryme_newdecisiontable&lt;/addr:To>
>  
>          <addr:Action 
> xmlns:addr="http://www.w3.org/2005/08/addressing";>urn:invokeDecisionTable</addr:Action>
>  
>          <addr:ReplyTo xmlns:addr="http://www.w3.org/2005/08/addressing";> 
>             
> <addr:Address>http://www.w3.org/2005/08/addressing/anonymous&lt;/addr:Address>
>  
>          </addr:ReplyTo> 
>          <addr:MessageID 
> xmlns:addr="http://www.w3.org/2005/08/addressing";>uuid:53870713-5719-457f-9965-0ebd111e7dda-5</addr:MessageID>
>  
>       </soapenv:Header> 
>       <soapenv:Body> 
>          <invokeDecisionTable xmlns="http://newdecisiontable.tryme";> 
>             <ns:param0 xmlns:ns="http://newdecisiontable.tryme";> 
>                <ax25:person xmlns:ax25="http://newdecisiontable.tryme/xsd";> 
>                   <ax26:age xmlns:ax26="http://newdecisiontable.tryme/bre"; /> 
>                   <ax26:greeting 
> xmlns:ax26="http://newdecisiontable.tryme/bre"; /> 
>                   <name xmlns="http://newdecisiontable.tryme/bre"; 
> xmlns:ax26="http://newdecisiontable.tryme/bre";>Oleg</name> 
>                </ax25:person> 
>             </ns:param0> 
>          </invokeDecisionTable> 
>       </soapenv:Body> 
>    </soapenv:Envelope>
> will not be deserialized because BeanUtil.deserialize(methodElement, 
> parameters, objectSupplier) will be fed with element <soapenv:Body> instead 
> of element <ns:param0>.
> The fix is pretty simple, instead of above code there should be:
>             if (inAxisMessage.isWrapped()) {
>                 objectArray = 
> RPCUtil.processRequest(methodElement.getFirstElement(),
>                         method, 
> inMessage.getAxisService().getObjectSupplier());
>             } else {
>                 objectArray = RPCUtil.processRequest(methodElement,
>                         method, 
> inMessage.getAxisService().getObjectSupplier());
>             }

-- 
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