Android 10 Changing @ sign to @ when sending auth header through Ksoap2

145 Views Asked by At

I have a webservice that is starting to fail when calling from Android 10 because Android 10 appears to be changing the '@' to '&#64 ;' (the ascii code for the @ sign)..

We have one user that has an '@' in their username, example: username@areaname

On all other devices from Android 4.4 to Android 9.0, this comes through the SOAP envelope just fine, as 'username@areaname'.

However, for some reason, all Android 10 devices are changing this to 'username&#64 ;areaname'.

Does anyone have any idea why this is happening and how to avoid it?

Here is some of the code, even though I don't think it'll help with anything.. I believe I've explained the anomaly the best that I can.

    request = new SoapObject(NAMESPACE, REQUEST);
    PropertyInfo pi = new PropertyInfo();
    pi.setName("token");
    pi.setValue(tokenvalue);
    request.addProperty(pi);
    
    envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

    Element headers[] = new Element[1];
    headers[0]= new Element().createElement("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security");
    headers[0].setAttribute(envelope.env, "mustUnderstand", "1");
    Element security=headers[0];

    Element token = new Element().createElement(security.getNamespace(), "UsernameToken");
    token.setAttribute("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "Id", "UsernameToken-13");

    Element username = new Element().createElement(security.getNamespace(), "Username");
    username.addChild(Node.TEXT, usernamevalue);
    token.addChild(Node.ELEMENT,username);

    Element password = new Element().createElement(security.getNamespace(), "Password");
    password.setAttribute(null, "Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText");
    password.addChild(Node.TEXT, passwordvalue);
    token.addChild(Node.ELEMENT,password);

    headers[0].addChild(Node.ELEMENT, token);

    envelope.headerOut = headers;
    envelope.dotNet = false;
    envelope.implicitTypes = false;
    envelope.setOutputSoapObject(request);

    httpTransport = new HttpTransportSE(STALL_SOAP_URL);

    try{
        httpTransport.call(STALL_SOAP_ACTION, envelope);
    }catch(Exception e){
        e.printStackTrace();
    }
0

There are 0 best solutions below