0

hi i'm trying to make a soap request but i don't get any response. I dont know why.. I'm following this example http://www.ilias.de/docu/ilias.php?ref_id=951&from_page=16155&cmd=layout&cmdClass=illmpresentationgui&cmdNode=57&baseClass=ilLMPresentationGUI&obj_id=16157 but i cant get any responses :( This is my code:

import java.io.IOException;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;

public class SOAPExample
{

    public String login()
    {
        String session = null;

        // first log in as a user with administrative rights and retrieve your session id
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        SoapObject soapObject = new SoapObject("urn:ilUserAdministration", "login");
        soapObject.addProperty("client", "client3");
        soapObject.addProperty("username", "stacked");
        soapObject.addProperty("password", "overflow");
        envelope.setOutputSoapObject(soapObject);
        HttpTransportSE transport = new HttpTransportSE("http://www.ilias.de/test310/webservice/soap/server.php");
        transport.debug = true;
        try
        {
            transport.call("login", envelope);
            session = envelope.getResponse().toString();
            return session;
        }
        catch (IOException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        catch (XmlPullParserException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        if (session == null)
        {
            System.out.println("Your login wasn't successful");
        }
        return null;
    }

    /**
     * @param args
     */
    public static void main(String[] args)
    {
        // TODO Auto-generated method stub
        SOAPExample se = new SOAPExample();
        String sid = se.login();
        System.out.println(sid);

    }

}
Alexx Perez
  • 215
  • 2
  • 10
  • 19
  • Not enough information. Please describe in detail what happens. – Jim Garrison Nov 11 '11 at 16:58
  • I just want to get my login id. This is the error SoapFault - faultcode: 'Client' faultstring: 'Error building dsn/Wrong client Id?' faultactor: '' detail: org.kxml2.kdom.Node@9be79a at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(Unknown Source) at org.ksoap2.SoapEnvelope.parse(Unknown Source) at org.ksoap2.transport.Transport.parseResponse(Unknown Source) at org.ksoap2.transport.HttpTransportSE.call(Unknown Source) at Soap.login(Soap.java:30) at Soap.main(Soap.java:58) – Alexx Perez Nov 11 '11 at 19:51
  • I think your `SOAPACTION` in `transport.call("login", envelope); ` is wrong it should be either `transport.call("urn:ilUserAdministration#login", envelope); ` or `transport.call("urn:ilUserAdministration/login",envelope);`.Try using this & tell the result. – Shashank_Itmaster Nov 29 '11 at 08:03

1 Answers1

0

From the little I understood from your code, I feel you are trying to authenticate a user by creating a login application.

I have done a similar thing before on Android using ksoap.

You can refer this. This might just give you a hint on how you should go about using ksoap.

Hope I have helped you,

Cheers

Community
  • 1
  • 1
Parth Doshi
  • 4,200
  • 15
  • 79
  • 129