2

以下のコードを使用しました

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();
    }

}
}

それに応じて、私はこのようなxmlを持っています

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

GetList メソッドから回答を取得できるように、次に何をすべきか。どのように認証すればよいですか?

GetList メソッドの METHOD_NAME、SOAP_ACTION、およびその他のパラメーターを変更すると、エラー - 403 禁止されています。間違った認証を引き起こすので、正しいクエリを作成するにはどうすればよいですか? または、次のクエリの最初の回答をどうすればよいですか?

4

0 に答える 0