开发者

Using xml input type to wcf webmethod

开发者 https://www.devze.com 2023-03-20 08:39 出处:网络
I\'m quite new to wcf. I\'m in the process of converting an .asmx service (methods only) to wcf service. I h开发者_如何学编程ave 4 methods in the service class with farely simple parameters, but one o

I'm quite new to wcf. I'm in the process of converting an .asmx service (methods only) to wcf service. I h开发者_如何学编程ave 4 methods in the service class with farely simple parameters, but one of the methods has an xmldocument as parameter. Like:

public ServiceObject(xmldocument x, string y, ...){}

This parameter can of course not be serialized, and I get an error on this!

How do one come around this problem, or am I just using wcf the wrong way. When I outcomment the operationcontract in the interface the other methods with simple parameters run just fine.

Do I have to use properties or what...

Any help is appreciated, cheers Finn.


In your service operation use an XElement instead of XmlDocument and then convert to an XmlDocument inside the operation if you need to

0

精彩评论

暂无评论...
验证码 换一张
取 消