Windows Phone 7和SOAP标头 [英] Windows Phone 7 and SOAP headers

查看:126
本文介绍了Windows Phone 7和SOAP标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个使用其他自定义SOAP标头的Web服务.
一个普通的WPF项目(在添加服务引用时)会为声明这些标头的方法生成相应的参数,因此它们将作为客户端的方法参数传递.
但是在WP7 Silverlight项目中,WebServiceSoapClient类不使用这些头. 它们的类由VS2010生成,但未在代码中使用.

Web服务的代码如下所示

Hi,

I have a web service which uses additional custom SOAP headers.
An ordinary WPF project (when adding service reference) generates corresponding parameters for the methods these headers are declared for, so they are passed as method''s parameters on the client side.
But in the WP7 Silverlight project these headers are not used by the WebServiceSoapClient class.
Their classes are generated by VS2010, but they are not used in the code.

The code of the web-service looks like the following

[XmlRoot("MySoapHeader")]
public class MySoapHeader : SoapHeader
{ ... }

public class MyService
{
MySoapHeader m_mySoapVar;

[WebMethod]
[SoapHeader("m_mySoapVar", Direction = SoapHeaderDirection.InOut)]
public void MyMethod(string name)
{ ... }
}



WP7的服务客户端如下所示:



The service client for WP7 is like this:

public class MySoapHeader {}

public class MyServiceSoapClient
{
   public void MyMethodAsync(string name) {}
}


而已.不用使用MySoapHeader.

有什么方法可以在调用MyServiceSoapClient.MyMethod()时从客户端发送我的标头,以及在调用完成后获取IN标头?

我不相信WP7不支持SOAP标头

谢谢,
Alex


Thats it. Nothing about using MySoapHeader.

Is there any way to send my headers from the client when calling MyServiceSoapClient.MyMethod() and to get IN headers after call is finished ?

I don''t believe SOAP headers are not supported by WP7

Thanks,
Alex

推荐答案

此帮助是否有用- ^ ]?
Would this help - http://thusithamabotuwana.wordpress.com/2010/11/13/getting-started-with-windows-7-phone-application-development/[^]?


这篇关于Windows Phone 7和SOAP标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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