SOAP encoding in Windows Store App

喜你入骨 提交于 2019-12-13 13:17:25

问题


I am trying to create a Windows Store App that consumes a web service. Visual Studio denies to create service proxy methods with following warning in logs:

Custom tool warning: Contract ... is not compatible with Windows Store apps because it contains one or more operations with SOAP Encoding (use='encoded'). Only the non-encoded operations will be generated.

So the questions are:

Where can I find full list of Windows Store app limitations on web services consumption?
Are there any known workarounds (given I can't change the service)?


回答1:


It seems you're pretty much screwed if you can't change the web service because of the way that any wrappers are most likely SOAP encoded, and also the SOAP Toolkit doesn't allow for much output customisation.

Perhaps writing a (possibly functionally duplicated) web.api based webservice is a better solution? See this link for an example

EDIT: In response to the first comment...

Yes and no; essentially create a REST (whether that be webapi, WCF etc is upto you) wrapper.

See these informative posts on creating a REST wrapper:

helpfull post number 1 and helpfull post number 2




回答2:


You can create a NETStandard class library to reference the webservice, then reference this library to your web project.



来源:https://stackoverflow.com/questions/15485561/soap-encoding-in-windows-store-app

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