开发者

passing xml to a webservice

I have a simple web service that will have one method: DoTransactions(xlm)

Now the reason that i am using XML as a parameter is due to the fact that the parameters开发者_如何转开发 will often change. So for example it could be:

<payload>
 <userId>1234</userid>
 <partnerId>ptn654</partnerId>
</payload>

OR

<payload>
 <partnerId>ptn654</partnerId>
 <items>
  <item1>
   <cost>10</cost>
   <description>This is item 1</description>
  </item1>
 </items>
</payload>

As you can see the XML string will always change (this is due to a client request)

Would it be better to rather pass in a string and parse the XML in the method or should is there a better way to do it.

This web service will be used for varios different code languages.


If the data is forever changing then I would stick to what you are doing.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜