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

Ortwin Glück updated AXIS-1977:
-------------------------------

    Attachment: AXIS-1977.diff

fixed NPE regression

> Axis is not honoring the useSOAPAction to invoke services
> ---------------------------------------------------------
>
>                 Key: AXIS-1977
>                 URL: https://issues.apache.org/jira/browse/AXIS-1977
>             Project: Axis
>          Issue Type: Bug
>          Components: Serialization/Deserialization
>    Affects Versions: 1.2RC3
>            Reporter: Jim Peterson
>         Attachments: AXIS-1977.diff, RPCElement.java
>
>
> If multiple methods are declared in the wsdl with the same signature, Axis 
> cannot resolve the correct method to call and just picks the first method 
> with a matching signature even though the message delares that useSOAPAction 
> = true and a SOAPAction is specified.
> To get around this limitation, I modified the deserialize() method of 
> org.apache.axis.message.RPCElement to check for the useSOAPAction parameter 
> and match the method name to the SOAPAction if useSOAPAction = true.  Here's 
> the code snippet:
>     public void deserialize() throws SAXException
>     {
>         needDeser = false;
>         MessageContext msgContext = context.getMessageContext();
>         // Figure out if we should be looking for out params or in params
>         // (i.e. is this message a response?)
>         Message msg = msgContext.getCurrentMessage();
>         SOAPConstants soapConstants = msgContext.getSOAPConstants();
>         boolean isResponse = ((msg != null) &&
>                               Message.RESPONSE.equals(msg.getMessageType()));
>         // We're going to need this below, so create one.
>         RPCHandler rpcHandler = new RPCHandler(this, isResponse);
>         if (operations != null) {
>             int numParams = (getChildren() == null) ? 0 : 
> getChildren().size();
>             SAXException savedException = null;
>             // By default, accept missing parameters as nulls, and
>             // allow the message context to override.
>             boolean acceptMissingParams = msgContext.isPropertyTrue(
>                     MessageContext.ACCEPTMISSINGPARAMS,
>                     true);
>             // We now have an array of all operations by this name.  Try to
>             // find the right one.  For each matching operation which has an
>             // equal number of "in" parameters, try deserializing.  If we
>             // don't succeed for any of the candidates, punt.
>             for (int i = 0; i < operations.length; i++) {
>                 OperationDesc operation = operations[i];
> /*********************************************************************/
> /****       Recommened change to support the use of SOAP Action   ****/
> /*********************************************************************/
>                 // Check if the SOAP Action URI is to be used.
>                 //if so, ensure the current operation matches before 
> processing it
>                 if (msgContext.useSOAPAction()) {
>                     String soapActionURI = msgContext.getSOAPActionURI();
>                     String operationName = operation.getName();
>                     if (!(operationName.equals(soapActionURI))) {
>                         continue;
>                     }
>                 }
> /*********************************************************************/
> /*********************************************************************/
>                 // See if any information is coming from a header
>                 boolean needHeaderProcessing =
>                     needHeaderProcessing(operation, isResponse);
>                                 :
>                                 :

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to