如何在 Windows Mobile 客户端上报告 Web 服务的进度?
我尝试使用肥皂扩展来实现进度报告,如以下链接所述:
但是,我的“ProgressUpdate”方法没有被调用,我相信这是因为我的 Windows Mobile 项目中没有 app.config 文件来告诉 SOAP 扩展要处理的 Web 服务调用。在 Windows Mobile 中如何做到这一点?这是本文中使用的示例配置文件:
<?xmlversion="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<webServices>
<soapExtensionTypes> <add
type="SoapExtensionLib.ProgressExtension, SoapExtensionLib"
priority="1" group="High" />
</soapExtensionTypes>
</webServices>
</system.web>
</configuration>
I have tried to implement progress reporting using a soap extension as described at the following links:
However, my "ProgressUpdate" method is not being called, and I believe that is because I haven't got an app.config file in my Windows Mobile project to tell the web service calls to be processed by the SOAP Extension. How can do it in Windows Mobile? This is the sample config file used in the article:
<?xmlversion="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<webServices>
<soapExtensionTypes> <add
type="SoapExtensionLib.ProgressExtension, SoapExtensionLib"
priority="1" group="High" />
</soapExtensionTypes>
</webServices>
</system.web>
</configuration>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想出了如何通过向生成的代理类内的方法添加自定义属性来实现此目的。自定义属性派生自 SoapExtensionAttribute。
我在 MSDN 获取了信息
现在的问题是如果我刷新 Web 服务引用,我必须记住重新添加该属性............
I figured out how to do this by adding a custom attribute to the method inside the generated proxy class. The custom attribute is derived from SoapExtensionAttribute.
I got the information at MSDN
Problem now is that I have to remember to add the attribute back in if I refresh the web service reference..............