object作为webservice中的参数 [英] object as parameter in webservice

查看:158
本文介绍了object作为webservice中的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有朋友都好。


 


我被困在我的申请表中。我正在使用Web应用程序与Flex应用程序进行通信。在我的Web服务中,我将对象作为参数。我通过我的网络应用程序通过flex应用程序发送的对象类型是XML,这是因为肥皂而预期。


 


现在请告诉我我如何将这个xmltype恢复回对象。或换句话说,我如何在我的应用程序中使用此对象。


来源类似于:


 





[webmethod]


public void getvalue(object param)


{


// code





}


 


提前谢谢

解决方案

您不应将对象类型用作参数或返回值。它只是意味着"某事在这里",并没有告诉任何人
是什么


如果你想传递一个任意的块然后使用XmlElement作为参数类型:


 [WebMethod] 
public void getvalue( System.Xml.XmlElement param)
{
// code

}


Hi to all friends out there.

 

I am stuck in my application. I am using web application to communicate to flex application.In my web service i have object as parameter. type of object which i sending by flex application through my web application is XML which is expected due to soap.

 

Now please tell me how i get back this xmltype back to object. or in other words how i consume this object in my application.

source is something like:

 


[webmethod]

public void getvalue(object param)

{

// code


}

 

Thank you in advance

解决方案

You should not use the object type as a parameter or return value. It just means "something is here", and doesn't tell anyone what is there.

If you want to pass an arbitrary block of XML, then use XmlElement as the parameter type:

[WebMethod]
public void getvalue(System.Xml.XmlElement param)
{
// code

}


这篇关于object作为webservice中的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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