我可以将对象传递到Web服务吗 [英] can i pass object into a webservice

查看:104
本文介绍了我可以将对象传递到Web服务吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我试图将类的对象传递到Web服务,但我只需要在类中使用承包商,就没有任何帮助方法,而我的问题是,在我自己编写的服务端,我找不到服务对象的任何价值.您能告诉我如何约束使用的类或消费者类吗?

Hi
i am trying to pass object of a class into webservice but i need to use only constractor in class no any helper method and my problem is that at service end which is written by myself , i does not find any value at service object . can u tell me how i constract the class which uses or consumer class

推荐答案

亲爱的Manoj Sing,

到目前为止,我知道,您不能在Web方法中使用发送给类的构造函数的参数,最好将参数直接传递给Web服务中的Web方法,对不起,如果我无法清楚地理解您的问题. >
谢谢
Dear Manoj Sing,

So far I know, you can not use the parameter sent to constructor of class in a web method, you better pass parameters directly to your web method in a web service, sorry if I couldn''t understand your question clearly.

Thanks


您的对象必须从ISerializable派生,才能将其传递到Web服务或从Web服务传递.

Google是您的朋友.

如果您决定要传递参数,我写了一个提示/技巧,展示了如何将任意数量的任何类型的参数传递给Web服务方法.

将动态参数列表传递到Web Service.aspx [ ^ ]
Your object has to be derived from ISerializable in order for it to be passed to/from a web service.

Google is your friend.

If you decide that you want to pass parameters, I wrote a tip/trick that shows how to pass any number of params of any type to a web service method.

Pass Dynamic List of Parameters to Web Service.aspx[^]


这篇关于我可以将对象传递到Web服务吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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