2

I used the code below

public class SharepointListActivity extends Activity {

private static final String SOAP_ACTION = "http://schemas.microsoft.com/sharepoint/soap/Login";
private static final String METHOD_NAME = "Login";
private static final String NAMESPACE = "http://schemas.microsoft.com/sharepoint/soap/" ;
private static final String URL = "http://192.168.0.25:1000/_vti_bin/authentication.asmx";


private TextView result;
private Button btnSubmit;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    result = (TextView)findViewById(R.id.editText1);

    btnSubmit = (Button)findViewById(R.id.button1);

    btnSubmit.setOnClickListener(new OnClickListener(){
        public void onClick(View v) {
            if(v.getId() == R.id.button1)
            {
                String list = getMobileTestList();
                result.setText(list);
            }

        }

    });


}
private String getMobileTestList()
{
    PropertyInfo pi = new PropertyInfo();



    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);


    List<HeaderProperty> headers = new ArrayList<HeaderProperty>();

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);


    HttpTransportSE transport = new HttpTransportSE(URL);
    try
    {
        transport.debug = true;
        transport.call(SOAP_ACTION, envelope);
        Object result = envelope.getResponse();


        return result.toString();

    }
    catch(Exception e)
    {
        return e.toString();
    }

}
}

and in response I have xml like this

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<LoginResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<LoginResult>
<CookieName>FedAuth</CookieName>
<ErrorCode>NoError</ErrorCode>
<TimeoutSeconds>1800</TimeoutSeconds>
</LoginResult>
</LoginResponse>
</soap:Body>
</soap:Envelope>

What I should do next so I can fetch answer from GetList method. How I should auth in?

If I change METHOD_NAME, SOAP_ACTION and other params for GetList method I have error - 403 forbidden. cause wrong auth so how should I build correct query? or what should i do with first answer for next query?

Gorets
  • 2,434
  • 5
  • 27
  • 45
  • my sharepoiont friends said that I should catch cookies(connect token) and attact it to following query to SP server, but I think it's wrong and I don't know how to attach it. – Gorets Feb 28 '12 at 13:55
  • I've done like in this topic: http://stackoverflow.com/questions/6381491/how-to-save-and-return-cookies-to-the-web-service, but I have same mistake - Content-Length underflow and dont know how to solve it. Plz help. – Gorets Feb 28 '12 at 16:11

0 Answers0