MonoTouch,Sharepoint Web服务和xs:any [英] MonoTouch, Sharepoint web services and xs:any

查看:94
本文介绍了MonoTouch,Sharepoint Web服务和xs:any的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以通过Web服务调用以与SharePoint一起一起工作以与MonoTouch/MonoDevelop/Mono一起使用吗?

Has ANYONE gotten a web service call to work with SharePoint to operate with MonoTouch/MonoDevelop/Mono??

我能够从典型端点(在这种情况下为/_vti_bin/Lists.asmx)中获取WSDL,MonoDevelop将按预期方式创建Reference.cs.

I am able to get the WSDL from the typical endpoint (/_vti_bin/Lists.asmx in this case), and MonoDevelop creates a Reference.cs as expected.

我已经修改了Reference.cs以包含"name"参数,因此所有XmyAnyElements现在都看起来像: [System.Xml.Serialization.XmlAnyElement("Any",")]//名称和名称空间

I have modified the Reference.cs to include the "name" parameter, so all XmyAnyElements now look like: [System.Xml.Serialization.XmlAnyElement("Any","")] //name and namespace

尽管可以编译,但运行时抱怨XmlNode.公平地说,我将其放入XmlNode []中,因此它可以是invoke []似乎想要的数组.

While this can compile, runtime complains about the XmlNode. Fair enough, I made it into XmlNode[] so it could be an array, which invoke[] seems to want.

然后,我构建一个GetListItemsQuery并将其通过以下方式传递给我的GetListItems调用: var result = svc.GetListItems("Tasks",null,q,null,"100",null,null);

I then build a GetListItemsQuery and pass it along to my GetListItems call via: var result = svc.GetListItems ("Tasks", null, q, null, "100", null, null);

虽然我可以连接并让Web服务进行响应,但所有响应都将在Any字段中以空返回.

While I can connect and get the web service to respond, all responses are coming back with null in the Any field.

推荐答案

我发现有效的方法令人沮丧,但成功.

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

在Windows机器上启动Visual Studio,启动一个老式的.Net 2.0 Windows窗体应用程序,然后连接到相同的WSDL .这将创建一个新的Reference.cs文件. 将该文件带入您的MonoTouch应用程序中.

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.

修改构造函数以使用OLD MonoTouch构造函数,因为.Net 2.0无法编译.

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

导入的构造函数

/// <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生成(我用过):

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

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

更改后,应用程序将编译,结果= svc.GetListItems()实际上将返回XmlNodes中的数据!

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

这篇关于MonoTouch,Sharepoint Web服务和xs:any的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆