有人接到网络服务电话上班吗与 SharePoint与 MonoTouch/MonoDevelop/Mono 一起操作?
我能够从典型端点(本例中为 /_vti_bin/Lists.asmx)获取 WSDL,并且 MonoDevelop 按预期创建一个 Reference.cs。
我已经修改了 Reference.cs 以包含“name”参数,因此所有 XmyAnyElements 现在看起来像:
[System.Xml.Serialization.XmlAnyElement("Any","")] //名称和命名空间
虽然可以编译,但运行时会抱怨 XmlNode。公平地说,我将其放入 XmlNode[] 中,因此它可以是一个数组,这似乎是 invoke[] 想要的。
然后,我构建一个 GetListItemsQuery 并将其传递给我的 GetListItems 调用:
var result = svc.GetListItems("任务", null, q, null, "100", null, null);
虽然我可以连接并让 Web 服务做出响应,但所有响应都会在 Any 字段中返回 null。
我发现工作相当令人沮丧,但很成功。
在 Windows 计算机上启动 Visual Studio,启动老式 .Net 2.0 windows 窗体应用程序,然后连接到相同的 WSDL。这将创建一个新的 Reference.cs 文件。将该文件放入您的 MonoTouch 应用程序中。
修改构造函数以使用旧的 MonoTouch 构造函数,因为 .Net 2.0 无法编译。
导入构造函数
/// <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() 将实际返回 XmlNode 中的数据!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)