views:

41

answers:

1

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.

+2  A: 

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

James
do you mean pass a string as a parameter?
Neale
@Neale: yes pass your xml over as a string. Passing over XML only means it is easier to maintain i.e. say you need to support a new parameter, its just a case of updating your parser to accomodate. No need for any client side changes.
James
I will try this and will see how it goes. Thanks
Neale