Off by one error in SOAP 1.2 action processing
----------------------------------------------

                 Key: AXIS2-1118
                 URL: http://issues.apache.org/jira/browse/AXIS2-1118
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: transports
            Reporter: Matt Lovett
            Priority: Minor


While debugging a failing Sandesha unit test (the SOAPVersionTest), I was 
getting failures to do with soap action mismatches. I've tracked the defect to 
the following code in HTTPTransportUtils, around line 216:

                            String transientString = 
contentType.substring(index, contentType.length());
                            int equal = transientString.indexOf("=");
                            int firstSemiColon = transientString.indexOf(";");
                            String soapAction; // This will contain "" in the 
string
                            if (firstSemiColon > -1) {
                                soapAction = transientString.substring(equal + 
1, firstSemiColon - 1);

In my case with the string like: action="....";

The substring cuts one too far, setting soapAction to: "....
Note there is no trailing " any more, which then messes up the code that 
attempts to trim quotes off
each end of the string.

The fix is trivial:
-                                soapAction = transientString.substring(equal + 
1, firstSemiColon - 1);
+                                soapAction = transientString.substring(equal + 
1, firstSemiColon);

Thanks

Matt

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to