[jira] Created: (AXIS-1977) Axis is not honoring the useSOAPAction to invoke services

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (AXIS-1977) Axis is not honoring the useSOAPAction to invoke services

JIRA axis-dev@ws.apache.org
Axis is not honoring the useSOAPAction to invoke services
---------------------------------------------------------

         Key: AXIS-1977
         URL: http://issues.apache.org/jira/browse/AXIS-1977
     Project: Axis
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: 1.2RC3    
    Reporter: Jim Peterson


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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (AXIS-1977) Axis is not honoring the useSOAPAction to invoke services

JIRA axis-dev@ws.apache.org
     [ http://issues.apache.org/jira/browse/AXIS-1977?page=all ]

Jim Peterson updated AXIS-1977:
-------------------------------

    Attachment: RPCElement.java

The updated RPCElement.java file is attached.

> Axis is not honoring the useSOAPAction to invoke services
> ---------------------------------------------------------
>
>          Key: AXIS-1977
>          URL: http://issues.apache.org/jira/browse/AXIS-1977
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC3
>     Reporter: Jim Peterson
>  Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira