passing xml to a webservice
Posted
by Neale
on Stack Overflow
See other posts from Stack Overflow
or by Neale
Published on 2010-04-26T10:08:20Z
Indexed on
2010/04/26
10:13 UTC
Read the original article
Hit count: 171
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.
© Stack Overflow or respective owner