开发者

WCF Operation parameter string vs .Net Type (Best Practice)

I'm developing a web services to be consumed by java and php clients.

When we write an operation that accepts Order Object, is it ok to do the below?

void getOrderDetail (Order order)

OR

void getOrderDetail(String order)

//Where order i开发者_开发技巧s a xml

Basically, what i'm after is:

  1. What is the best practice to achieve above?
  2. Should it problem with clients if my operation accepts Order Type?

Thank you . Thanks.


I'd go with #1. Self-describing operations are always a win- "string" doesn't give a smarter client (ie, one that can generate wire-type stubs like WCF, Axis, etc) any hints about what to do. If you use strong types on the wire, the resultant WSDL acts as a first level of documentation that can also be consumed by a client generator.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜