MonoTouch, Sharepoint web services and xs:any

大兔子大兔子 提交于 2019-12-04 12:29:26

What I have found that works is quite frustrating, but successful.

Pull up Visual Studio on a Windows machine, start an old-school .Net 2.0 windows form app, and connect to the same WSDL. This will create a new Reference.cs file. Bring that file into your MonoTouch app.

Modify the constructor to use the OLD MonoTouch constr, as the .Net 2.0 one will not compile.

Imported constructor

/// <remarks/>
    public Lists() {
        *this.Url = global::test.Properties.Settings.Default.test_gxgvwn1_Lists; //BREAKS HERE, BY THAT'S OK!*
        if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
            this.UseDefaultCredentials = true;
            this.useDefaultCredentialsSetExplicitly = false;
        }
        else {
            this.useDefaultCredentialsSetExplicitly = true;
        }
    }

MonoTouch generated (I used this):

    public Lists() {
        this.Url = "http://www.mysite.com/_vti_bin/Lists.asmx";
    }

    public Lists(string url) {
        this.Url = url;
    }

Once that is changed, the app will compile and the result = svc.GetListItems() will actually return data in the XmlNodes!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!