获取生成的服务引用SOAP客户端以使用XElement进行服务调用 [英] Get generated Service Reference SOAP client to use XElement for Service Calls

查看:66
本文介绍了获取生成的服务引用SOAP客户端以使用XElement进行服务调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在升级使用服务引用生成的SOAP客户端的客户端应用程序,以便从旧的SharePoint服务器切换到SharePoint Online。我使用了Add->" Service Reference"上下文菜单选项从
生成客户端

最好的问候

亚伯拉罕


I am upgrading a client application, that uses a Service Reference generated SOAP client, to switch from an old SharePoint server to SharePoint Online. I have used the Add->"Service Reference" context menu choice to generate a client from a https://myorg.sharepoint.com/data/_vti_bin/lists.asmx URL. The problem is that calls like ListsSoapClient.GetListCollection() uses XmlNode as return type but the rest of the application expects Linq.XElement as return type, which the old Service Reference client used.

What can I do to get Visual Studio 2017 to generate a Service Reference SOAP client that uses Linq.XElement instead of XmlNode?

解决方案

As far as I know, XmlNode cannot be serialized, so it cannot be returned directly, try to return the XmlElement.
And select the reuse types in referenced assemblies. The client will get System.Xml.Linq.XElement

For the cross-platform purpose, we had better to use DataContract.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/using-data-contracts
Best Regards
Abraham


这篇关于获取生成的服务引用SOAP客户端以使用XElement进行服务调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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