1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

Login Share [Invalid data provided: 2]

Discussion in 'Developing, APIs and extending' started by Helge Savelos, Nov 7, 2011.

  1. Helge Savelos

    Helge Savelos Member

    I get the errror when trying to use the login share Invalid data provided: 2

    When the data returned fro failed login all works fine but when returning a sucessfull login the error comes up.
    Perhaps i am missing something or there should be more info returned from my side?
    Here is whats my side is responding with

    <?xml version="1.0" encoding="UTF-8"?>

    <loginshare>

    <result>1</result>

    <user>

    <usergroup>Registered</usergroup>

    <fullname>User Name</fullname>

    <emails>

    <email>email@email.net</email>

    </emails>

    </user>

    </loginshare>
     
  2. Gary McGrath

    Gary McGrath Staff Member

    I think you need to return phone aswell. e.g.


    <?xml version="1.0" encoding="UTF-8"?>
    <loginshare>
    <result>1</result>
    <user>
    <usergroup>Registered</usergroup>
    <fullname>John Doe</fullname>
    <designation>CEO</designation>
    <emails>
    <email>john.doe@kayako.com</email>
    </emails>
    <phone>123-456-789</phone>
    </user>
    </loginshare>

    Gary
     
  3. Helge Savelos

    Helge Savelos Member

    I have already tried returning all possible fields , still no joy :(
     
  4. Gary McGrath

    Gary McGrath Staff Member

    Looking on the wiki, invalid data 2 means "invalid xml", so its not liking the format rather than the data.

    Try clearing out whitespace etc.. before returning the xml ( e.g. Trim() around the returned XML )

    Gary
     
  5. Helge Savelos

    Helge Savelos Member

    I have also tried trimming the data without success. As i said i return the failed login reponse exactly the same way , same encoding same responding etc and it works :(
     
  6. Gary McGrath

    Gary McGrath Staff Member

    what version of kayako are you running?

    Gary
     
  7. Helge Savelos

    Helge Savelos Member

  8. Gary McGrath

    Gary McGrath Staff Member

    Was it working on the previous build you used? I am wondering if maybe something was changed in the 649.

    If it was working before, it might be worth submitting a ticket to kayako directly about it

    gary
     
  9. Helge Savelos

    Helge Savelos Member

    Basically before there was another bug that didnt allow it to work. They fixed in the latest build but then this error started to popup.
    You where right about invalid xml as the error log report the same.
    Going to open support ticket! Thank you for your help.
     
  10. Abelone

    Abelone New Member

    Have you managed to get it to work now? We have the same problem after upgrading to 649. Have submitted a ticket, but haven received a sensible answer.
     
  11. Helge Savelos

    Helge Savelos Member

    The initial problem was resolved in the latest build.
    And after trial and error i was able to send valid responses by using this configuration

    Code:
    private XmlWriter GetWriter(MemoryStream xmlStream)
            {
                XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = false;
                settings.CloseOutput = true;
                settings.OmitXmlDeclaration = false;
                settings.Encoding = new UTF8Encoding();
                settings.NewLineHandling = NewLineHandling.Entitize;
                var writer = XmlWriter.Create(xmlStream, settings);
                XmlDocument d = new XmlDocument();
                XmlDeclaration declaration = d.CreateXmlDeclaration("1.0", "UTF-8", null);
                declaration.WriteTo(writer);
                return writer;
            }
    
    The most important is to have Indent disabled.
     
  12. jason starr

    jason starr New Member

    I am getting this error with V4 we are testing the fusion install and I gave the sso api access to PBA for staff logins
     

Share This Page